Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (!StartAI)
     {
         return;
     }
     if (m_isFirst)
     {
         m_countTime = Time.time + FirstDecision;
         m_isFirst   = true;
     }
     if (Time.time > m_countTime)
     {
         m_countTime = Time.time + DecisionTime;
         if (AutoFight)
         {
             CheckBattleState();
         }
     }
     if (m_createFinishTime <= 0)
     {
         m_createFinishTime = Time.time + CreateAnimalDelta;
     }
     if (Time.time >= m_createFinishTime)
     {
         m_createFinishTime = Time.time + CreateAnimalDelta;
         if (AnimalChecker && AnimalChecker.CanCreateAnimal())
         {
             AnimalChecker.CreateAnimal();
         }
     }
 }