private void FinishSequence() { AppTouchManager.Instance.OnTap.RemoveListener(this.HandleTap); RhythmSequenceResult result = this._result; this.DoAfterDelay(0.1f, () => { this.OnSequenceFinished.Invoke(this, result); }); this._result = null; }
private void HandleSequenceFinished(RhythmSequence sequence, RhythmSequenceResult result) { this._result = result; this.DoAfterDelay(this._attackStartDelay, () => { sequence.OnSequenceFinished.RemoveListener(this.HandleSequenceFinished); this._actor.FlashyAnimateTo(this._target.AttackedPosition, this._rushTrigger, this._additionalScaling); this.DoAfterDelay(0.2f, () => { this._actor.transform.position = new Vector3(this._actor.transform.position.x, this._actor.transform.position.y, this._actor.transform.position.z - 6.0f); }); this._actor.OnFinishedFlashyAnimating.AddListener(this.Attack); }); }
private void HandleSequenceFinished(RhythmSequence sequence, RhythmSequenceResult result) { Vector3 storedPosition = this.transform.position; if (result.keyframeCount == 3 || result.keyframeCount == 4) { this.DoAfterDelay(0.2f, () => { string prefabName = ""; if (result.keyframeCount == result.perfectHitCount) { prefabName = "UltimateFloatingTextSFX"; CameraController.Main <CameraController>().Shake(GameConstants.Instance.kAttackShakeMagnitude * 1.0f, GameConstants.Instance.kAttackShakeDuration * 2.0f); } else if (result.keyframeCount == result.missCount) { prefabName = "SubparFloatingTextSFX"; CameraController.Main <CameraController>().Shake(GameConstants.Instance.kAttackShakeMagnitude * 0.7f, GameConstants.Instance.kAttackShakeDuration * 2.0f); } else { prefabName = "PrettyGoodFloatingTextSFX"; CameraController.Main <CameraController>().Shake(GameConstants.Instance.kAttackShakeMagnitude * 0.3f, GameConstants.Instance.kAttackShakeDuration * 2.0f); } SoundManager.Instance.PlaySoundFile(4); GameObject floatingTextSFXObject = Toolbox.GetInstance <ObjectPoolManager>().Instantiate(prefabName); floatingTextSFXObject.transform.SetParent(CanvasUtil.MainCanvas.transform, worldPositionStays: false); RectTransform rectTransform = (RectTransform)floatingTextSFXObject.transform; Vector2 anchoredPosition = rectTransform.anchoredPosition; if (storedPosition.x > 0.0f) { anchoredPosition = anchoredPosition.SetX(-anchoredPosition.x); } // rectTransform.anchoredPosition = anchoredPosition + (Vector2)Camera.main.WorldToScreenPoint(storedPosition); FloatingTextSFX floatingTextSFX = floatingTextSFXObject.GetComponent <FloatingTextSFX>(); floatingTextSFX.SetText(""); }); } foreach (KeyValuePair <RhythmSequenceKeyframe, RhythmSequenceKeyframeVisualizer> pair in this._visualizerMap) { pair.Value.FadeAway(); } this._container.SetActive(false); }