Code refactor
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WaypointVisual : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private ParticleSystem _particleSystem;
|
||||
[SerializeField]
|
||||
private Transform _wayPoint;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
MouseInputManager.Instance.OnMovementTargetSelected += Mouse_OnMovementTargetSelected;
|
||||
}
|
||||
|
||||
private void Mouse_OnMovementTargetSelected(object sender, OnMovementTargetSelectedEventArgs e)
|
||||
{
|
||||
_wayPoint.position = e.PointToMove;
|
||||
_particleSystem.Play();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
MouseInputManager.Instance.OnMovementTargetSelected -= Mouse_OnMovementTargetSelected;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user