コード例 #1
0
ファイル: TroopBaseFSM.cs プロジェクト: otoolew/Aberdeen
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     unitObject = animator.gameObject;
     navAgent   = unitObject.GetComponent <NavMeshAgent>();
     troopAgent = unitObject.GetComponent <TroopAgent>();
     unitWeapon = unitObject.GetComponent <UnitWeaponBehavior>();
 }
コード例 #2
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     unitObject = animator.gameObject;
     navAgent   = unitObject.GetComponent <NavMeshAgent>();
     unitBrain  = unitObject.GetComponent <UnitBrain>();
     unitWeapon = unitObject.GetComponent <UnitWeaponBehavior>();
     //unitHUD = unitBrain.GetComponent<UnitHUD>();
     unitTarget = unitBrain.CurrentTarget;
 }
コード例 #3
0
ファイル: UnitBrain.cs プロジェクト: otoolew/Aberdeen
 // Use this for initialization
 void Start()
 {
     animator          = GetComponent <Animator>();
     navAgent          = GetComponent <NavMeshAgent>();
     unitWeapon        = GetComponent <UnitWeaponBehavior>();
     unitHUD           = GetComponent <UnitHUD>();
     visionCollider    = GetComponent <SphereCollider>();
     VisableTargetList = new List <Transform>();
     InitWayPath();
 }
コード例 #4
0
ファイル: StateController.cs プロジェクト: otoolew/Aberdeen
 private void Start()
 {
     unitWeapon   = GetComponent <UnitWeaponBehavior>();
     navMeshAgent = GetComponent <NavMeshAgent>();
     animator     = GetComponent <Animator>();
 }