Esempio n. 1
0
 void Start()
 {
     movement = GetComponent <EnemyMovment> ();
     sight    = GetComponent <EnemySight> ();
     weapon   = GetComponent <EnemyAttack> ();
     nearby   = GetComponent <EnemyNearby> ();
     cState   = State.Default;
     movement.ReturnToPatrol();          //Start Patroling
     prevState = cState;
 }
 //  Start void to create the decision tree.
 void Start()
 {
     enemCheck = new EnemyNearby(this,
                                 new CheckNearSaferoom(this,
                                                       new runToSafeRoomScript(this),
                                                       new MoveTowardsArea(this)),
                                 new FullOfFood(this,
                                                new CheckNearSilo(this,
                                                                  new FoodDepositScript(this),
                                                                  new MoveTowardsArea(this)),
                                                new CheckNearFarm(this,
                                                                  new FoodCollectScript(this),
                                                                  new MoveTowardsArea(this))));
 }