Exemplo n.º 1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (life != null)
     {
         if (normalBrain != null && !life.getContaminated() && mv != null)
         {
             normalBrain.Act(mv);
         }
         if (infectedBrain == null && life.getContaminated() && normalBrain != null && mv != null)
         {
             normalBrain.Act(mv);
         }
         else if (infectedBrain != null && life.getContaminated() && mv != null)
         {
             infectedBrain.Act(mv);
         }
     }
     else if (normalBrain != null && mv != null)
     {
         normalBrain.Act(mv);
     }
 }
Exemplo n.º 2
0
    protected void Update()
    {
        brain.Act(Time.deltaTime);

        behaviourTree.CalculateAndSetNextState(false);

        try
        {
            state.Tick(Time.deltaTime);
        }
        catch (System.NullReferenceException)
        {
            Debug.LogWarning("No state asigned for Update in " + gameObject.name, gameObject);
        }
    }
Exemplo n.º 3
0
 public Command Act(GameState gameState) => Brain.Act(this, gameState);
Exemplo n.º 4
0
 private void DoTurn()
 {
     brain.Act();
 }