Exemple #1
0
 private void WaitToSeek()
 {
     pickupSounds.Play();
     print("Leaving the house!");
     machine.CurrentState         = QuestAIStateMachine.State.Wander;
     gemMode.transform.localScale = new Vector3(0.75f, 0.75f, 1.0f);
     gemMode.SetActive(false);
 }
Exemple #2
0
 void CreateCoin()
 {
     if (eatSounds != null)
     {
         eatSounds.Play();
     }
     Instantiate(coin, transform.position, Quaternion.identity);
 }
Exemple #3
0
    private void EatOther(GameObject other)
    {
        if (other == null)
        {
            return;
        }

        if (eatSounds != null)
        {
            eatSounds.Play();
        }
        if (willStarve != null)
        {
            willStarve.DidEat();
        }

        var onDie = other.GetComponent <OnDie>();

        if (onDie != null)
        {
            onDie.Die();
        }

        machine.currentState = AIStateMachine.State.Wander;

        if (onDie == null)
        {
            if (other.tag == "Mushroom" || other.tag == "Coin")
            {
                other.transform.DOScale(0, dieTime).OnComplete(() => DestroyCallback(other));
            }
            else if (other.tag != "Player")
            {
                Destroy(other);
            }
        }
    }