// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-12-23 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using UnityEngine; namespace G { /// /// /// public class Footstep : MonoBehaviour { private EntityMainPlayer _scriptCha; private bool _turnOn; private float _delay; private ParticleSystem _particle; private void Start() { _scriptCha = EntityMainPlayer.Instance; _particle = GetComponentInChildren(); _particle.Stop(); } private void Update() { if (_delay > 0.5f) { var moveState = _scriptCha.moveState; if (moveState == MoveState.state2_Run) { if (!_turnOn) { _turnOn = true; _particle.Play(); } } else { _turnOn = false; _particle.Stop(); } } else { _delay += Time.deltaTime; } } } }