void Update() { float distanceFromPlayer = footprintManager.GetDistanceToPlayer(transform.position); FootprintState newState = myFootprintStateObject.CheckChangeConditions(distanceFromPlayer, footprintManager); if (newState != null) { myFootprintStateObject = newState; myFootprintStateObject.SetFootprintState(GetComponentInChildren <Renderer>().material, footprintManager); } if (myFootprintStateObject.GetType() == typeof(FootprintStateActive)) { if (distanceFromPlayer < footprintManager.GetDistanceToMissStep()) { footprintManager.FootprintMissed(this); } } }
public void SetAsUpNext() { myFootprintStateObject = new FootprintStateReady(); myFootprintStateObject.SetFootprintState(GetComponentInChildren <Renderer>().material, footprintManager); }
void Start() { myFootprintStateObject = new FootprintStateInactive(); footprintManager = Player.Instance.GetComponent <FootprintManager>(); footprintManager.RegisterFootprint(this); }