void SkillPlace() { if (skillPlaced) { bool attacked = skillPlaceComponent.DangerSkillAttacked("SkillChaging", "Skill"); if (attacked) { myState = TitanState.AutoAttacking; Destroy(instantSkillEffect.gameObject); instantSkillEffect = null; skillPlaced = false; } } else { skillPlaced = true; Quaternion effectQua = new Quaternion(); effectQua = Quaternion.Euler(new Vector3(-90, 0, 0)); instantSkillEffect = Instantiate(sphereSkillEffect, transform.position, effectQua); instantSkillEffect.transform.parent = transform; GameObject ShotSkill = null; Vector3 targetPosition = transform.position; animator.SetBool("PunchSkill", false); switch (skill) { case (TitanSkill.CenterSphere): ShotSkill = sphereSkill; targetPosition = new Vector3(3.5f, 0, -12.0f); break; case (TitanSkill.Punch): ShotSkill = punchSkill; targetPosition = new Vector3(0, 0, 15); animator.SetBool("PunchSkill", true); break; case (TitanSkill.AllRange): ShotSkill = allRange; targetPosition = new Vector3(0, 0, 0); break; case (TitanSkill.Line): ShotSkill = line; targetPosition = new Vector3(0, 0, 0); break; //default: // ShotSkill = sphereSkill; // break; } skillPlaceComponent.SkillPlace(ShotSkill, targetPosition, "SkillChaging"); } }
void SkillPlace() { if (skillPlaced) { bool attacked = skillPlaceComponent.DangerSkillAttacked("SkillChaging", "Skill"); if (attacked) { myState = KnightState.AutoAttacking; Destroy(instantSkillEffect.gameObject); instantSkillEffect = null; skillPlaced = false; } } else { skillPlaced = true; Quaternion effectQua = new Quaternion(); effectQua = Quaternion.Euler(new Vector3(-90, 0, 0)); instantSkillEffect = Instantiate(chagingSkillEffect, transform.position, effectQua); instantSkillEffect.transform.parent = transform; GameObject ShotSkill = null; Vector3 targetPosition = new Vector3(0, 0, 0); Quaternion targetQua = new Quaternion(); switch (skill) { case (KnightSkill.RangeSmash): ShotSkill = tripleSphereSkill; targetPosition = new Vector3(3.5f, 0, -12.0f); break; case (KnightSkill.Slash): ShotSkill = crossSkill; targetPosition = transform.position; break; case (KnightSkill.Dunut): ShotSkill = donut; targetPosition = transform.position; break; default: ShotSkill = tripleSphereSkill; targetPosition = new Vector3(3.5f, 0, -12.0f); break; } skillPlaceComponent.SkillPlace(ShotSkill, targetPosition, "SkillChaging"); } }
void SkillPlace() { if (skillPlaced) { bool attacked = skillPlaceComponent.DangerSkillAttacked("SkillChaging", "Skill"); if (attacked) { myState = SkeltonState.AutoAttacking; Destroy(instantSkillEffect.gameObject); instantSkillEffect = null; skillPlaced = false; } } else { skillPlaced = true; Quaternion effectQua = new Quaternion(); effectQua = Quaternion.Euler(new Vector3(-90, 0, 0)); instantSkillEffect = Instantiate(sphereSkillEffect, transform.position, effectQua); instantSkillEffect.transform.parent = transform; GameObject ShotSkill = null; Vector3 targetPosition = transform.position; switch (skill) { case (SkeltonSkill.SphereExplosion): ShotSkill = sphereSkill; break; case (SkeltonSkill.Search): ShotSkill = searchSkill; targetPosition = target.GetPosition(); break; default: ShotSkill = sphereSkill; break; } skillPlaceComponent.SkillPlace(ShotSkill, targetPosition, "SkillChaging"); } }