public void ProcessGesture(GestureType gestureType) { if (usingSpecialSkill && gestureType == gesturesToMatch.Peek()) { GestureActiveSet?.Invoke(GestureCount - gesturesToMatch.Count, false); gesturesToMatch.Dequeue(); if (gesturesToMatch.Count == 0) { usingSpecialSkill = false; tweener?.Kill(); TimerFilled?.Invoke(0f); SpecialSkillApplied?.Invoke(); } } if (gestureType >= GestureType.Circle) { if (usingSpecialSkill == false) { SkillDrawn?.Invoke(gestureType); } } else { GestureDrawn?.Invoke(gestureType); // TODO: 몬스터 제거 시 발동으로 바꿔야 함 SpecialSkillLevel.UpdateLevel(1); } }
public void Foo() { var allGestures = GestureResources.Instance.AllGestures; var count = allGestures.Count(); for (var i = 0; i < GestureCount; i++) { var gesture = allGestures.ElementAt(Random.Range(0, count - 1)); gesturesToMatch.Enqueue(gesture); GestureActiveSet?.Invoke(i, true); GestureSpriteSet?.Invoke(i, GestureResources.Instance.Sprite(gesture)); gesture.Log(); } var fillAmount = 1f; usingSpecialSkill = true; tweener = DOTween.To(() => fillAmount, value => fillAmount = value, 0f, timerDuration) .SetEase(Ease.Linear) .OnUpdate(() => TimerFilled?.Invoke(fillAmount)) .OnComplete(() => { usingSpecialSkill = false; FailurePenalty(); for (var i = 0; i < GestureCount; i++) { GestureActiveSet?.Invoke(i, false); } }); }