Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     NextButton.onClick.AddListener(() =>
     {
         SkipEvent?.Invoke();
     });
 }
 public void OnSkip(InputAction.CallbackContext context)
 {
     if (context.phase == InputActionPhase.Performed)
     {
         SkipEvent.Invoke();
     }
 }
Beispiel #3
0
 public void Setup(string title, SkipEvent skipEvent)
 {
     btn            = btn != null ? btn : GetComponentInChildren <Button>();
     btnText        = btnText != null ? btnText : btn.GetComponentInChildren <TextMeshProUGUI>();
     text           = text != null ? text : GetComponentInChildren <TextMeshProUGUI>();
     this.title     = title;
     this.skipEvent = skipEvent;
     SetText(skipEvent.Skip);
     btn.onClick.AddListener(Click);
 }
        public void ApplySkip(SkipEvent skip)
        {
            Group?.SkipEventSequence(skip.Event.Sequence);

            // You have to reset the CancellationToken for the group
            Group?.Reset();

            Cancellation = Group?.Cancellation ?? Cancellation;


            // Basically saying that the attempts start over when we skip
            Attempts = 0;
            Delay    = default;
        }
Beispiel #5
0
        public async Task ApplySkipAsync(SkipEvent skip)
        {
            if (Group != null)
            {
                await Group.SkipEventSequence(skip.Event.Sequence).ConfigureAwait(false);

                // You have to reset the CancellationToken for the group
                Group.Reset();
                Cancellation = Group.Cancellation;
            }

            // Basically saying that the attempts start over when we skip
            Attempts = 0;
            Delay    = default;
        }
Beispiel #6
0
    public void SkipTransition()
    {
        if (afterAnimationCoroutineIsRunning)
        {
            StopCoroutine(afterAnimationCoroutine); /// you need this because you don't want this effect to take place unintentionally
            afterAnimationCoroutineIsRunning = false;
        }
        animator.Play(currentAnimationClipName, -1, 1);
        isDuringTransition         = false;
        currentTransitionType      = TransitionType.None;
        currentAnimationClipName   = "";
        currentAnimationClipLength = 0;
        DefaultState?.Invoke();

        SkipEvent?.Invoke(sceneDataArray[currentSceneNumber - 1]);
        if (ar != null)
        {
            ar.QueueMessage("SkipTransition");
        }
    }
Beispiel #7
0
 private void ToggleEvent(string title, SkipEvent skipEvent) => Instantiate(skippedEvent, container).Setup(title, skipEvent);