示例#1
0
文件: Explode.cs 项目: Greg-Rus/Game
 void deductHealth(Collider col)
 {
     if (healthManager = col.GetComponent<Health>()){
         healthManager.takeDamage(20f);
     }
     else if (NPCStats = col.GetComponent(typeof(F_Stats)) as F_Stats){
         NPCStats.takeDamage(20f);
     }
     else if (tRig = col.rigidbody.GetComponentInChildren<AIRig>())
         {
             Debug.Log (tRig);
             float currentHelath = tRig.AI.WorkingMemory.GetItem<float>("health");
             tRig.AI.WorkingMemory.SetItem<float>("health", currentHelath - 20f);
         }
 }
示例#2
0
 public DestroyedState(F_TankController NPC)
 {
     stateID = StateID.Destroyed;
     myController = NPC;
     mySensor = myController.GetComponentInChildren<F_PasiveSensor>();
     myNav = myController.GetComponent<NavMeshAgent>();
     myTargetting = myController.GetComponent<F_Targetting>();
     myAttack = myController.GetComponent<TankMinionAttack>();
     myStats = myController.GetComponent<F_Stats>();
     myControlMode = myController.GetComponent<F_ControlMode>();
 }