void FindRabbit() { if (rabbitTransform == null) { RabbitAI ai = FindObjectOfType <RabbitAI>(); if (ai != null) { rabbitTransform = ai.transform; } } }
//嚎叫 void TryHowl() { if (Random.Range(0f, 1f) < howlChance) { Howl(); //TODO: rabbit force detect; if (rabbitTransform != null) { RabbitAI ai = rabbitTransform.GetComponent <RabbitAI>(); if (ai != null) { ai.Detected(); } } } }
protected override void InitializeAI() { AI = new RabbitAI(this); Components.Add(AI); }