private void OnTriggerEnter(Collider other) { if (firstAtk) { bool trig = false; if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion"))) { if (other.gameObject.Equals(mySkill.gameObject)) { return; } ChampionBehavior cB = other.GetComponent <ChampionBehavior>(); if (cB.Team != mySkill.TheChampionBehaviour.Team) { trig = true; float damage = mySkill.skillData.rDamage[mySkill.TheChampionData.skill_R - 1] + mySkill.Acalculate(mySkill.skillData.rAstat, mySkill.skillData.rAvalue); if (cB != null) { if (cB.HitMe(damage, "AP", mySkill.gameObject, mySkill.name)) { mySkill.TheChampionAtk.ResetTarget(); } cB.myChampAtk.PauseAtk(3.5f, true); cB.myChampAtk.StunEffectToggle(true, 0); cB.myChampAtk.StunEffectToggle(false, 3.5f); //cB.myChampAtk.PauseMove(3.5f * 10f); Collider[] col = Physics.OverlapSphere(cB.transform.position, 12); foreach (Collider c in col) { if (c.gameObject.layer.Equals(LayerMask.NameToLayer("Champion"))) { ChampionBehavior cCB = c.GetComponent <ChampionBehavior>(); if (cCB != null) { if (cCB.Team != mySkill.TheChampionBehaviour.Team) { //if(cCB.name.Contains("asd")) //{ // print(""); if (cCB.HitMe(damage / 2f, "AP", mySkill.gameObject, mySkill.name)) { // 스킬쏜애 주인이 나면 킬올리자 if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player)) { mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 0, other.transform.position); //if (!sysmsg) // sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent<SystemMessage>(); //sysmsg.sendKillmsg("ashe", other.GetComponent<ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString()); } } } } } } } } } if (trig) { gameObject.SetActive(false); firstAtk = false; } } }
private void OnTriggerEnter(Collider other) { a.Add(other.gameObject); if (firstAtk) { bool trig = false; if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Champion"))) { if (!other.gameObject.Equals(mySkill.gameObject)) { ChampionBehavior mB = other.GetComponent <ChampionBehavior>(); if (mB.Team != mySkill.TheChampionBehaviour.Team) { trig = true; float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1] + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue); if (mB != null) { if (mB.HitMe(damage, "AD", mySkill.gameObject, mySkill.name)) { mySkill.TheChampionAtk.ResetTarget(); if (!sysmsg) { sysmsg = GameObject.FindGameObjectWithTag("SystemMsg").GetComponent <SystemMessage>(); } //sysmsg.sendKillmsg("ashe", other.GetComponent<ChampionData>().ChampionName, mySkill.TheChampionBehaviour.Team.ToString()); // 스킬쏜애 주인이 나면 킬올리자 if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player)) { mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 0, other.transform.position); } } } } } } else if (other.gameObject.layer.Equals(LayerMask.NameToLayer("Monster"))) { MonsterBehaviour mB = other.GetComponent <MonsterBehaviour>(); float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1] + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue); if (mB != null) { trig = true; if (mB.HitMe(damage, "AD", mySkill.gameObject)) { mySkill.TheChampionAtk.ResetTarget(); //// 스킬쏜애 주인이 나면 킬올리자 //if (mySkill.GetComponent<PhotonView>().owner.Equals(PhotonNetwork.player)) //{ // //mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 3, other.transform.position); //} } } } else if (other.tag.Equals("Minion")) { MinionBehavior mB = other.GetComponent <MinionBehavior>(); if (!other.name.Contains(mySkill.TheChampionBehaviour.Team)) { trig = true; float damage = mySkill.skillData.wDamage[mySkill.TheChampionData.skill_W - 1] + mySkill.Acalculate(mySkill.skillData.wAstat, mySkill.skillData.wAvalue); if (mB != null) { if (mB.HitMe(damage, "AD", mySkill.gameObject)) { mySkill.TheChampionAtk.ResetTarget(); // 스킬쏜애 주인이 나면 킬올리자 if (mySkill.GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player)) { mySkill.TheChampionData.Kill_CS_Gold_Exp(other.gameObject.name, 1, other.transform.position); } } } } } if (trig) { gameObject.SetActive(false); firstAtk = false; } } }