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>(); }
public void Start() { petAnimationScript = gameObject.GetComponentInChildren <PetMovement>(); petMovement = gameObject.GetComponentInParent <PetBasicAI>(); }