Esempio n. 1
0
    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);
            }
        }
    }
Esempio n. 2
0
 public void SetAsUpNext()
 {
     myFootprintStateObject = new FootprintStateReady();
     myFootprintStateObject.SetFootprintState(GetComponentInChildren <Renderer>().material, footprintManager);
 }
Esempio n. 3
0
 void Start()
 {
     myFootprintStateObject = new FootprintStateInactive();
     footprintManager       = Player.Instance.GetComponent <FootprintManager>();
     footprintManager.RegisterFootprint(this);
 }