示例#1
0
 void FindRabbit()
 {
     if (rabbitTransform == null)
     {
         RabbitAI ai = FindObjectOfType <RabbitAI>();
         if (ai != null)
         {
             rabbitTransform = ai.transform;
         }
     }
 }
示例#2
0
 //嚎叫
 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();
             }
         }
     }
 }
示例#3
0
 protected override void InitializeAI()
 {
     AI = new RabbitAI(this);
     Components.Add(AI);
 }