Пример #1
0
 private void AutoLockForClipDuration()
 {
     try
     {
         LockTimestamp = AnimationClipDurationMap[OwnAnimator.GetCurrentAnimatorClipInfo(0)[0].clip.name] / OwnAnimator.GetCurrentAnimatorStateInfo(0).speed;
         // It will reset the timestamp duration and extend the coroutine if it already run.
         if (!OnTriggerLockRoutine)
         {
             StartCoroutine(Lock_Coroutine());
         }
     }
     catch
     {
         Verbose(VerboseMask.WarningLog, "Fail to AutoLockForClipDuration!");
     }
 }
Пример #2
0
        protected override void InputPhase()
        {
            base.InputPhase();

            if (Game.IsAutoPlay)
            {
                if (Game.IsStarted.Equals(true) && (int)Mode < 6 && CurrentFrame >= RunningFrames - 0.5f && !IsHit)
                {
                    if (Mode.Equals(NoteInfo.SlideNoteCheckpoint))
                    {
                        Erase();
                    }
                }
            }
            else
            {
                if ((int)Mode < 10 && !Mode.Equals(NoteInfo.SlideNoteCheckpoint) && Input.touchCount > 0 && ((Game.Judger.NoteQueue[EndLine].Count < 1 || Game.Judger.NoteQueue[EndLine][0].Equals(ID)) || (Mode.Equals(NoteInfo.LongNoteEnd) && Game.Dispensor.Notes[TailsFromPrevious[0].OwnerID].IsHit)))
                {
                    if (Flick.Equals(FlickMode.None))
                    {
                        for (int i = 0; i < Input.touchCount; i++)
                        {
                            Vector3 point = SyncPosition(Input.GetTouch(i).position);
                            if ((Mode.Equals(NoteInfo.LongNoteEnd) || Mode.Equals(NoteInfo.SlideNoteEnd)) && Input.GetTouch(i).phase.Equals(TouchPhase.Ended))
                            {
                                Hit(point, Input.GetTouch(i).fingerId);
                            }
                        }
                    }
                }
                if ((Mode.Equals(NoteInfo.LongNoteStart) || Mode.Equals(NoteInfo.SlideNoteStart)) && IsHit)
                {
                    for (int i = 0; i < Input.touchCount; i++)
                    {
                        Vector3 point = SyncPosition(Input.GetTouch(i).position);
                        if ((Input.GetTouch(i).phase.Equals(TouchPhase.Began) || Input.GetTouch(i).phase.Equals(TouchPhase.Stationary) || Input.GetTouch(i).phase.Equals(TouchPhase.Moved)))
                        {
                            if (point.x >= FlickBorderLeft && point.x < FlickBorderRight && !IsSlideHolding)
                            {
                                IsSlideHolding      = true;
                                OwnAnimator.enabled = true;
                                gameObject.transform.GetChild(0).gameObject.SetActive(true);
                                OwnAnimator.Play("HoldEffect");
                                TouchedFinger = Input.GetTouch(i).fingerId;
                            }
                            else if (Input.GetTouch(i).fingerId.Equals(TouchedFinger) && !(point.x >= FlickBorderLeft && point.x < FlickBorderRight) && IsSlideHolding)
                            {
                                IsSlideHolding      = false;
                                OwnAnimator.enabled = false;
                                gameObject.transform.GetChild(0).gameObject.SetActive(false);
                                TouchedFinger = 100;
                            }
                        }
                        if (Input.GetTouch(i).fingerId.Equals(TouchedFinger) && Input.GetTouch(i).phase.Equals(TouchPhase.Ended))
                        {
                            IsSlideHolding      = false;
                            OwnAnimator.enabled = false;
                            gameObject.transform.GetChild(0).gameObject.SetActive(false);
                            TouchedFinger = 100;
                        }
                    }
                }
            }
        }