public void Skill2() { if (isSkill2) { return; } if (Input.GetKeyDown(KeyCode.Alpha2)) { if (isNormal) { Skill2_Test.SetActive(true); } else { Skill2_Test2.SetActive(true); } isSkill2End = true; } if (isSkill2End) { if ((isNormal && Skill2_Test2.activeSelf) || (!isNormal && Skill2_Test.activeSelf)) { Skill2_Test.SetActive(false); Skill2_Test2.SetActive(false); isSkill2End = false; } } if ((isNormal && Skill2_Test.activeSelf) || (!isNormal && Skill2_Test2.activeSelf)) { if (Input.GetMouseButtonDown(0)) { SetState(PlayerState.SKILL2); isSkill2 = true; isSkill2AttackTime = true; isSkill2Dash = true; return; } } }
public void Dash() { if (Input.GetKeyDown(KeyCode.Space)) { isAttackOne = false; isAttackTwo = false; isAttackThree = false; isFlash = true; isActive = true; FlashPosition = new Vector3(_anim.transform.position.x, _anim.transform.position.y + 0.83f, _anim.transform.position.z); FlashEffect2.SetActive(false); SetState(PlayerState.RUN); if (isSkill3) { Skill3_End.transform.position = Skill3_Start.transform.position; Skill3_End.transform.rotation = Skill3_Start.transform.rotation; Skill3_End.SetActive(true); } if ((isNormal && Skill2_Test.activeSelf) || (!isNormal && Skill2_Test2.activeSelf)) { Skill2_Test.SetActive(false); Skill2_Test2.SetActive(false); isSkill2End = false; } _Sound.sfx.PlayPlayerSFX(this.gameObject, _Sound.sfx.teleportSFX); } if (isFlash) { if (isNormal) { Normal.SetActive(false); } if (!isNormal) { Special.SetActive(false); } try { FlashEffect1.SetActive(true); FlashEffect1.transform.position = FlashPosition; FlashEffect2.transform.position = new Vector3(_anim.transform.position.x, _anim.transform.position.y + 0.83f, _anim.transform.position.z); } catch { } flashTimer += Time.deltaTime; if (_h >= 0.01f && flashTimer <= 0.2f) { _anim.transform.Translate(Vector3.right * 20f * Time.deltaTime); } if (_h <= -0.01f && flashTimer <= 0.2f) { _anim.transform.Translate(Vector3.right * -20f * Time.deltaTime); } if (_h == 0 && _v >= 0 && flashTimer <= 0.2f) { _anim.transform.Translate(Vector3.forward * 20f * Time.deltaTime); } if (_h == 0 && _v <= -0.01f && flashTimer <= 0.2f) { _anim.transform.Translate(Vector3.forward * -20f * Time.deltaTime); } if (flashTimer >= 0.2f && flashTimer <= 0.23f) { FlashEffect2.SetActive(true); } if (flashTimer >= 0.3f) { if (isNormal) { Normal.SetActive(true); } if (!isNormal) { Special.SetActive(true); } } if (flashTimer >= 0.33f && !isDashSound) { isDashSound = true; var voice = _Sound.voice; voice.PlayPlayerVoice(this.gameObject, voice.teleportVoice); } if (flashTimer >= 0.5f) { try { FlashEffect1.SetActive(false); } catch { } isFlash = false; isDashSound = false; isActive = false; UserInterface.Instance.UIPlayer.DashStart(); flashTimer = 0; return; } } }
public void ChangeModel() { if (isNormal && SpecialGauge >= 100) { if (Input.GetKeyDown(KeyCode.R)) { GameStatus.SetCurrentGameState(CurrentGameState.Product); isSpecial = true; SetInvincibility(true); TimeLine.SetActive(true); SetState(PlayerState.TRANS); //SetState(PlayerState.IDLE); // 스킬 1번 사라졌다 나오게 하기. Skill1Return(Skill1_Effects, Skill1_Special_Effects, isNormal); Skill1Return(Skill1_Shoots, Skill1_Special_Shoots, isNormal); Skill1PositionSet(Skill1_Effects, Skill1_Shoots, Skill1_Special_Shoots, isNormal); if (!Normal.activeSelf) { Normal.SetActive(true); } // 스킬2번 바닥 사라지게하기. if ((isNormal && Skill2_Test.activeSelf) || (!isNormal && Skill2_Test2.activeSelf)) { Skill2_Test.SetActive(false); Skill2_Test2.SetActive(false); isSkill2End = false; } } } if (isSpecial) {//11.6초후변신끝 WeaponTransformEffect.SetActive(true); specialTimer += Time.deltaTime; //if (specialTimer >= 0.6833f && !isTrans1) //{ //isTrans1 = true; //SetState(PlayerState.TRANS); //} if (specialTimer >= 1.5f) { isNormal = false; WeaponTransformEffect.SetActive(false); Special.SetActive(true); } if (specialTimer >= 2f) { Normal.SetActive(false); } if (specialTimer >= 5.82f) { Change_Effect.SetActive(false); //SetState(PlayerState.IDLE); } if (specialTimer >= 6.7f) { specialTimer = 0; TimeLine.SetActive(false); isSpecial = false; isAttackOne = false; SpecialGauge = 100; StartCoroutine(SetOff()); return; } } }