Пример #1
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.tag == "Enemy")
     {
         if (firedPressed)
         {
             if (col.gameObject.GetComponent <EnemyTypeController>().MyEnemyType == EnemyType.Boss)//BossComment added to check if boss, temporary
             {
                 col.gameObject.GetComponent <EnemyAI>().KillEnemy(false);
                 return;
             }
             if (CurrentlyKilledCount < KillLimit)
             {
                 col.gameObject.GetComponent <EnemyAI>().KillEnemy(true);
                 CurrentlyKilledCount++;
                 FinMode.IncreaseFinisherMeter(PlayerDamageValues.Instance.SiphoningFinMeterFill);
                 if (col.gameObject.GetComponent <EnemyTypeController>().MyEnemyType == EnemyType.IceEnemy)
                 {
                     DeadBodies[2].SetActive(true);
                 }
                 else if (col.gameObject.GetComponent <EnemyTypeController>().MyEnemyType == EnemyType.FireEnemy)
                 {
                     DeadBodies[1].SetActive(true);
                 }
                 else
                 {
                     DeadBodies[0].SetActive(true);
                 }
             }
         }
     }
     else if (col.gameObject.tag == "TargetDummy")
     {
         if (firedPressed)
         {
             if (CurrentlyKilledCount < KillLimit)
             {
                 Destroy(col.gameObject);
                 CurrentlyKilledCount++;
                 FinMode.IncreaseFinisherMeter(PlayerDamageValues.Instance.SiphoningFinMeterFill);
                 if (col.gameObject.GetComponent <EnemyTypeController>().MyEnemyType == EnemyType.IceEnemy)
                 {
                     DeadBodies[1].SetActive(true);
                 }
                 else
                 {
                     DeadBodies[0].SetActive(true);
                 }
             }
         }
     }
     else if (obstacleLayers.Contains(col.gameObject.layer))
     {
         if (firedPressed)
         {
             HitWall = true;
         }
     }
 }
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.tag != "Player")
     {
         return;
     }
     fm.IncreaseFinisherMeter(FinisherMeterFill);
     Destroy(gameObject);
 }
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag.Equals("Enemy"))
        {
            if (CurrentAttackType == AttackType.NormalBlade)
            {
                finisherObject.IncreaseFinisherMeter(PlayerDamageValues.Instance.NormalAttackFinMeterFill);
            }
            else
            {
                finisherObject.IncreaseFinisherMeter(PlayerDamageValues.Instance.ElementalSwordAttackFinMeterFill);
            }
            Enemyhp e = null;
            if ((e = col.GetComponent <Enemyhp>()) != null)
            {
                if (isHeavy)
                {
                    e.damage(currentSwordDamage * 1.5f, AttackType.HeavyBlade);
                }
                else
                {
                    e.damage(currentSwordDamage, CurrentAttackType);
                }

                Debug.Log(gameObject);
            }
        }
        else if (col.gameObject.tag.Equals("TargetDummy"))
        {
            finisherObject.IncreaseFinisherMeter(PlayerDamageValues.Instance.NormalAttackFinMeterFill);
            Enemyhp e = null;
            if ((e = col.GetComponent <Enemyhp>()) != null)
            {
                if (isHeavy)
                {
                    e.damage(currentSwordDamage * 2f, AttackType.HeavyBlade);
                }
                else
                {
                    e.damage(currentSwordDamage, CurrentAttackType);
                }
            }
        }
    }