Beispiel #1
0
 private IEnumerator UpdateEnumerator()
 {
     while (enabled)
     {
         if (IsThinking)
         {
             Perception.Update();
         }
         Memory.Update();
         if (IsThinking && !IsThrow)
         {
             Thinking.Update();
         }
         if (!IsThrow)
         {
             Steering.Update();
         }
         SoundEmission.Update();
         yield return(new WaitForSeconds(0.05f));
     }
 }
Beispiel #2
0
    public void Init()
    {
        if (IsThinking)
        {
            Perception = new Perception(this);
        }
        Memory = new Memory(this);
        if (IsThinking)
        {
            Thinking = new Thinking(this);
        }
        Steering      = new Steering(this);
        SoundEmission = new SoundEmission(this);

        InitPhysicsTraits();

        rb.velocity  = Vector3.zero;
        nav.velocity = Vector3.zero;
        nav.ResetPath();

        IsInit = true;
    }