Example #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag.Equals("Minion"))
     {
         MinionAtk mA = other.GetComponent <MinionBehavior>().minAtk;
         if (!mA.isPushing)
         {
             return;
         }
         mA.PushWall();
     }
     else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
     {
         ChampionAtk cA = other.GetComponent <ChampionBehavior>().myChampAtk;
         if (!cA.isPushing)
         {
             return;
         }
         cA.PushWall();
     }
     else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
     {
         MonsterAtk mA = other.GetComponent <MonsterBehaviour>().monAtk;
         if (!mA.isPushing)
         {
             return;
         }
         mA.PushWall();
     }
 }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        //미니언, 챔피언, 몬스터가 벽으로 밀쳐진다면 벽을 뚫고 지나가지 못하게 엮으로 밀어준다.
        if (other.gameObject.tag.Equals("Minion"))
        {
            MinionAtk minAtk = other.GetComponent <MinionBehavior>().minAtk;

            if (!minAtk.isPushing)
            {
                return;
            }

            minAtk.PushWall();
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion")))
        {
            ChampionAtk champAtk = other.GetComponent <ChampionBehavior>().myChampAtk;

            if (!champAtk.isPushing)
            {
                return;
            }

            champAtk.PushWall();
        }
        else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster")))
        {
            MonsterAtk monAtk = other.GetComponent <MonsterBehaviour>().monAtk;

            if (!monAtk.isPushing)
            {
                return;
            }

            monAtk.PushWall();
        }
    }