public void OnSkillColiider(GameObject other) { if (other != null) { Controller con = other.GetComponent <Controller>(); if (con != null && con.tag != controller.tag) { SkillCollider.HandleSkillHit(other.gameObject, controller, skillIndex, DEngine.Common.GameLogic.TargetType.EnemyOne); } } }
IEnumerator DoSkill56(Controller controller)//Detonate! { RoleSkill skill = controller.role.RoleSkills.FirstOrDefault(p => p.SkillId == 56); int skillIndex = controller.role.RoleSkills.IndexOf(skill); SoundManager.Instance.PlaySkillBegin(skill, controller); GameObject prefab = GetSkillPrefab(skill.SkillId); GameObject go = Instantiate(prefab, controller.transform.position, Quaternion.identity) as GameObject; SkillCollider.HandleSkillHit(null, controller, skillIndex, DEngine.Common.GameLogic.TargetType.EnemyGroup); gamePlayManager.SendSkillHit(controller.role.Id, controller.index, controller, skill); yield return(null); }
void OnCollisionEndTarget(GameObject other) { otherCollision = other; curState = SkillState.Colission; SkillCollider.HandleSkillHit(other, startTarget.GetComponent <Controller>(), skillIndex, DEngine.Common.GameLogic.TargetType.EnemyOne); }
IEnumerator DoSkill29(Controller controller)//Whirlwind { if (controller.target != null) { RoleSkill skill = controller.role.RoleSkills.FirstOrDefault(p => p.SkillId == 29); SoundManager.Instance.PlaySkillBegin(skill, controller); GameObject prefab = GetSkillPrefab(skill.SkillId); int skillIndex = controller.role.RoleSkills.IndexOf(skill); Transform wind = controller.transform.FindChild("Garuda_Wind"); if (wind != null) { wind.gameObject.SetActive(true); } controller.GetComponent <Animation>().CrossFade("BeginFly"); yield return(new WaitForSeconds(controller.GetComponent <Animation>()["BeginFly"].length)); Vector3 startPos = controller.transform.position; float time = Time.time; if (controller == null || controller.target == null) { if (controller != null) { controller.GetComponent <Animation>().CrossFade("EndFlying"); } yield return(null); } Vector3 dir = controller.target.transform.position - controller.transform.position; do { if (controller == null || controller.target == null) { break; } Vector3 endPos = controller.target.transform.position; float journeyLength = Vector3.Distance(startPos, endPos); dir = controller.target.transform.position - controller.transform.position; if (dir.magnitude > 6) { controller.GetComponent <Animation>().CrossFade("Flying"); } else { controller.GetComponent <Animation>().CrossFade("EndFlying"); } float distCovered = (Time.time - time) * controller.speedMove * 4; float fracJourney = distCovered / journeyLength; controller.transform.position = Vector3.Lerp(startPos, endPos, fracJourney); dir = controller.target.transform.position - controller.transform.position; yield return(null); }while (dir.magnitude > 1.5f); if (wind != null) { if (wind.gameObject.activeInHierarchy) { wind.gameObject.SetActive(false); } } GameObject cylone = GameObject.Instantiate(prefab, controller.transform.position, Quaternion.identity) as GameObject; // SoundManager.Instance.PlaySkillEnd(skill, controller); Destroy(cylone, 1.5f); yield return(new WaitForSeconds(0.7f)); SkillCollider.HandleSkillHit(null, controller, skillIndex, DEngine.Common.GameLogic.TargetType.EnemyGroup); } yield return(null); }