added: lock-on mechanics testing
This commit is contained in:
15
Assets/Scripts/Core/GenericLockOnTarget.cs
Normal file
15
Assets/Scripts/Core/GenericLockOnTarget.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GenericLockOnTarget : MonoBehaviour, ILockOnTarget{
|
||||
public float lockonTargetRadius{ get; set; } = 1f;
|
||||
public Renderer thisRenderer { get; }
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
void Update(){
|
||||
Debug.Log((this as ILockOnTarget).GetReticlePosition());
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Core/GenericLockOnTarget.cs.meta
Normal file
2
Assets/Scripts/Core/GenericLockOnTarget.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9e423f169119154e9b1379ef904eb46
|
||||
@@ -8,7 +8,6 @@ using UnityEngine.InputSystem;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions {
|
||||
|
||||
[Category("Reset/Movement")]
|
||||
public class AddJump : ActionTask<CharacterController> {
|
||||
public BBParameter<float> jumpStrength;
|
||||
|
||||
20
Assets/Scripts/Core/LockOnManager.cs
Normal file
20
Assets/Scripts/Core/LockOnManager.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class LockOnManager : MonoBehaviour{
|
||||
[ShowInInspector]
|
||||
public UIDocument lockOnDocument;
|
||||
[ShowInInspector, SerializeField]
|
||||
public ILockOnTarget lockOnTarget;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
Debug.Log(RuntimePanelUtils.CameraTransformWorldToPanel(lockOnDocument.rootVisualElement.panel, lockOnTarget.GetReticlePosition(), Camera.main.GetComponent<Camera>()));
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Core/LockOnManager.cs.meta
Normal file
2
Assets/Scripts/Core/LockOnManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 092c74123418b7a4482fc45aa5870077
|
||||
Reference in New Issue
Block a user