26 lines
567 B
C#
26 lines
567 B
C#
using UnityEngine;
|
|
|
|
public class WaypointVisual : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private ParticleSystem _particleSystem;
|
|
[SerializeField]
|
|
private Transform _wayPoint;
|
|
|
|
private void Start()
|
|
{
|
|
Player.Instance.OnPlayerMoves += Instance_OnPlayerMoves;
|
|
}
|
|
|
|
private void Instance_OnPlayerMoves(object sender, OnPlayerMovesEventArgs e)
|
|
{
|
|
_wayPoint.position = e.PointToMove;
|
|
_particleSystem.Play();
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
Player.Instance.OnPlayerMoves -= Instance_OnPlayerMoves;
|
|
}
|
|
}
|