コード例 #1
0
 private void OnEnable()
 {
     if ((leader == this) || (leader == null))
     {
         stateMachine.ChangeState(new IntercepterStates.IntercepterEmporerState(stateMachine, this, ShipManager.main.emporer));
     }
     else
     {
         stateMachine.ChangeState(new IntercepterStates.IntercepterEscortState(stateMachine, this, leader.boid));
         OffsetPursue offsetPursue = boid.GetBehaviour <OffsetPursue> ();
         if (offsetPursue != null)
         {
             offsetPursue.RefreshOffset();
         }
         else
         {
             offsetPursue = boid.GetComponent <OffsetPursue> ();
             if (offsetPursue != null)
             {
                 offsetPursue.RefreshOffset();
             }
         }
     }
 }
コード例 #2
0
        //[Header ("Banshee")]
        //public Ship leader;
        #endregion

        #region Mono Methods
        private void Start()
        {
            shipID       = ShipManager.main.AddShip(this);
            stateMachine = new ShipStateMachine(this);

            OffsetPursue offsetPursue = GetComponent <OffsetPursue> ();

            if (offsetPursue != null)
            {
                offsetPursue.leader = ShipManager.main.emporer.boid;
                offsetPursue.RefreshOffset();
            }

            stateMachine.ChangeState(new ProtonStates.ProtonPatrolState(stateMachine, this, ShipManager.main.emporer.boid));
        }