// Update is called once per frame void Update() { DestroyCount += Time.deltaTime; pmc.rotationSpeed = 1; //MARK: temporary slow player; pmc.walkSpeed = 2; CF.SetSensitivity(60); CMC.MoveToAimingLocation(false); //bool leftInput = Input.GetAxisRaw("Mouse X") > 0; // gets right //bool rightInput = Input.GetAxisRaw("Mouse Y") < 0; // gets left pmc.Aiming = true; if (DestroyCount > DestroyTime) { pmc.CanMove = true; pmc.Aiming = false; CF.RestoreSensitivity(); CMC.ReturnFromAimingLocation(); pmc.rotationSpeed = 60; pmc.walkSpeed = 6; Destroy(gameObject); } if (DestroyCount >= SpawnCount) { SpawnCount += FlameSpawnRate; Instantiate(MovingFlame, transform.position, transform.rotation); } }
public IEnumerator EnterFinisherMode(bool usedSwordGrapple) { GameStatus.FinisherModeActive = true; Player.GetComponent <PlayerMovementController>().PreventMoving(); Player.GetComponent <PlayerMovementController>().PreventTuring(); inFinisherMode = true; print("Begin Finisher"); swordController.PreventAttacking(); //move enemy into place and lock controls. PlayerRotWrapper.LookAt(new Vector3(currentTarget.transform.position.x, PlayerRotWrapper.transform.position.y, currentTarget.transform.position.z)); if (!PillarFinisherUsed) { if (currentTarget.tag != "TargetDummy") { currentTarget.GetComponent <EnemyMovementController>().StopMovement(); currentTarget.GetComponent <EnemyAI>().BeingFinished(); if (currentTarget.GetComponent <EnemyTypeController>().MyEnemyType == EnemyType.Boss) { savedAnimController = currentTarget.GetComponent <EnemyAI>().anim.runtimeAnimatorController; } if (enemyAnimator = currentTarget.GetComponent <EnemyAI>().anim) { enemyAnimator.runtimeAnimatorController = enemyAnimatorController; enemyAnimator.updateMode = AnimatorUpdateMode.UnscaledTime; enemyAnimator.Play("Finisher_Start"); } yield return(null); } } UIanim.Play("FinisherRunicIdleStance"); Time.timeScale = slowMoModifier; if (usedSwordGrapple) { //moves camera cam.MoveToAimingLocation(true); //Mark make sure camera takes as long as the animation usedSwordGrapple = false; //move sword forward and back over a small period SwordThrowAnimObj.SetActive(true); var savedSwordPos = SwordThrowAnimObj.transform.localPosition; var savedSwordRot = SwordThrowAnimObj.transform.localRotation; var currentSwordPos = SwordThrowAnimObj.transform.position; Vector3 FinalTarget = EnemyFinisherPlacement.position; float timeToMove = .25f; var t = 0f; while (t < 1) { t += Time.unscaledDeltaTime / timeToMove; SwordThrowAnimObj.transform.position = Vector3.Lerp(currentSwordPos, currentTarget.transform.position, t); yield return(null); } currentSwordPos = SwordThrowAnimObj.transform.position; var currentTargetPos = currentTarget.transform.position; t = 0f; while (t < 1) { t += Time.unscaledDeltaTime / timeToMove; SwordThrowAnimObj.transform.position = Vector3.Lerp(currentSwordPos, FinalTarget, t); currentTarget.transform.position = Vector3.Lerp(currentTargetPos, FinalTarget, t); yield return(null); } SwordThrowAnimObj.transform.localPosition = savedSwordPos; SwordThrowAnimObj.transform.localRotation = savedSwordRot; SwordThrowAnimObj.SetActive(false); CharAnim.Play("Finisher_Start"); yield return(null); } else { CharAnim.Play("Finisher_Start"); yield return(null); } currentTarget.transform.position = EnemyFinisherPlacement.position; currentTarget.transform.rotation = EnemyFinisherPlacement.rotation; if (!PillarFinisherUsed) { currentTarget.transform.Rotate(new Vector3(0, -40, 0)); } //currentTarget.transform.parent = EnemyFinisherPlacement; if (PillarFinisherUsed) { currentTarget.transform.position += Vector3.down; TutorialPopups.Instance.ShowTutorialPopup(PillarTutorial.FinisherUnlock); } //moves camera cam.MoveToFinisherModeLocation(); //Mark make sure camera takes as long as the animation if (PillarFinisherUsed) { PillarTutorial.PlayFirstHit(); } while (cam.GetIsMoving()) { CameraBase.rotation = Quaternion.Slerp(CameraBase.rotation, PlayerRotWrapper.rotation, .5f); yield return(null); } //waits till the camera and or animation is done CameraBase.rotation = PlayerRotWrapper.rotation; GetComponent <PlayerMovementController>().Aiming = false; PerformingFinisher = true; FinisherCount = FinisherTime; FinisherIcon.SetActivated(false); InFinisherIcons.SetActive(true); if (!PillarFinisherUsed) { RunicRinisherGuides.SetActive(true); } //RunicSequence.RestartQue(); RunicQue.Clear(); InputList.Clear(); //yield return null; }
// Update is called once per frame void Update() { if (!GameStatus.GamePaused && !GameStatus.FinisherModeActive) { if (buttonPressed && GameStatus.FinisherModeActive) { cancelAction = true; CurrentSword.GetComponent <ThrowLimb>().DestroyLine(); return; } if (CurrentSword == null) { return; } if (Input.GetButtonDown("SpecialAttack")) { CMC.MoveToAimingLocation(false); buttonPressed = true; } if (Input.GetButton("SpecialAttack")) { if (CurrentSword != null && buttonPressed) { CurrentSword.GetComponent <ThrowLimb>().ButtonHeld(); } } if (Input.GetButtonUp("SpecialAttack")) { buttonPressed = false; if (cancelAction) { CurrentSword.GetComponent <ThrowLimb>().DestroyLine(); cancelAction = false; return; } CMC.ReturnFromAimingLocation(); if (CurrentSword != null) { CurrentSword.GetComponent <ThrowLimb>().ButtonReleased(); } if (Swords.Count > 0) { CurrentSword = Swords[0]; Swords.RemoveAt(0); CurrentSword.transform.parent = transform; CurrentSword.transform.localPosition = Vector3.zero; CurrentSword.transform.localRotation = Quaternion.identity; } else { CurrentSword = null; } } int i = 0; foreach (GameObject sword in Swords) { sword.transform.parent = RotatingRing; switch (i) { case 0: sword.transform.localPosition = Vector3.up * .2f; break; case 1: sword.transform.localPosition = Vector3.down * .2f; break; case 2: sword.transform.localPosition = Vector3.right * .2f; break; case 3: sword.transform.localPosition = Vector3.left * .2f; break; } sword.transform.localRotation = Quaternion.identity; i++; } RotatingRing.Rotate(new Vector3(0, 0, 1)); } }