示例#1
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag == Tags.enemy)
     {
         WolfBaby baby = other.GetComponent <WolfBaby>();
         if (!wolfList.Contains(baby))
         {
             baby.TakeDamage(attack);
             wolfList.Add(baby);
         }
     }
 }
 public void OnTriggerEnter(Collider col)
 {
     if (col.tag == Tags.enemy)
     {
         WolfBaby baby  = col.GetComponent <WolfBaby>();
         int      index = wolfList.IndexOf(baby);
         if (index == -1)
         {
             baby.TakeDamage((int)attack);
             wolfList.Add(baby);
         }
     }
 }
示例#3
0
 public void OnTriggerEnter(Collider col)
 {
     if (col.tag == Tags.Enemy.ToString())
     {
         WolfBaby wolf  = col.GetComponent <WolfBaby>();
         int      index = wolfList.IndexOf(wolf);
         if (index == -1)
         {
             wolf.TakeDamage(attack);
             wolfList.Add(wolf);
         }
     }
 }
示例#4
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag.Equals("enemy"))
     {
         WolfBaby baby  = col.GetComponent <WolfBaby> ();
         int      index = wolflist.IndexOf(baby);
         if (index == -1)
         {
             baby.TakeDamage((int)attack);
             wolflist.Add(baby);
         }
     }
 }
示例#5
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == Tags.enemy)
     {
         GameObject go    = other.gameObject;
         WolfBaby   wolf  = go.GetComponent <WolfBaby>();
         int        index = wolfList.IndexOf(wolf);
         if (index == -1)
         {
             wolf.TakeDamage((int)attack);
             wolfList.Add(wolf);
         }
     }
 }
示例#6
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag == Tags.Enemy)
     {
         //对单个敌人只触发一次伤害
         WolfBaby baby  = other.GetComponent <WolfBaby>();
         int      index = wolfList.IndexOf(baby);
         if (index == -1)
         {
             baby.TakeDamage(PlayerStatus._instance.sum_attack * 4);
             wolfList.Add(baby);
         }
     }
 }