Exemple #1
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (this != instance)
        {
            Destroy(gameObject);
        }
        // Para o pet poder continuar a realizar suas ações mesmo quando o jogador não estiver na cena com o pet
        DontDestroyOnLoad(gameObject);

        pet    = gameObject.GetComponentInChildren <Pet>();
        player = SaveManager.instance.player;

        petAnimationScript = gameObject.GetComponentInChildren <PetMovement>();
        petHealth          = SaveManager.instance.player.health;

        petAccessInfoIndex = PetAccessListSelection();
        petAccessGraph     = petAccessInfo[petAccessInfoIndex].CreateGraph();

        IncreaseChanceCalculate();

        StartCoroutine(PetActionVerifier());
    }
 private void Awake()
 {
     petBasicAI = GameObject.FindGameObjectWithTag("PetFather").GetComponent <PetBasicAI>();
 }
Exemple #3
0
 public void Start()
 {
     petAnimationScript = gameObject.GetComponentInChildren <PetMovement>();
     petMovement        = gameObject.GetComponentInParent <PetBasicAI>();
 }