예제 #1
0
 private void OnTriggerEnter(Collider other)
 {
     // ターゲットが人間かタワーかも判定する
     target_type = human.GetTarget();
     if (other.transform.tag.Contains("Animal") &&
         target_type == Human.TargetType.animal)
     {
         CharacterDamage(other);
     }
     else if (other.transform.tag.Contains("Tower") &&
              target_type == Human.TargetType.tower)
     {
         TowerDamage(other);
     }
 }
예제 #2
0
 protected override void Awake()
 {
     human       = transform.root.gameObject.GetComponent <Human>();
     target_type = Human.TargetType.notTarget;
 }
예제 #3
0
 private void Update()
 {
     target_type = human.GetTarget();
 }