Exemplo n.º 1
0
 private void OnEnd()
 {
     Task task = Task.Factory.StartNew(() =>
     {
         OnEndEvent?.Invoke();
     }
                                       );
 }
Exemplo n.º 2
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Player") || collision.gameObject.CompareTag("Trailer"))
        {
            if (collision.contacts[0].thisCollider.CompareTag("Border"))
            {
                exercisesScriptable.IsPassed             = false;
                exercisesScriptable.Score                = 5;
                exercisesScriptable.PrematureTermination = true;

                OnEndEvent?.Invoke();
            }
        }
    }
Exemplo n.º 3
0
    public void EndExercise(bool withMiddleMistake)
    {
        if (withMiddleMistake)
        {
            AddMistakeInvoke(3);
        }

        CountScroreOfTasks?.Invoke();

        int currentScore = GameManager.CurrentScore;

        exercisesScriptable.IsPassed = currentScore < 5;
        exercisesScriptable.Score    = currentScore;
        OnEndEvent?.Invoke();
    }
    public IEnumerable RunCounter()
    {
        var waitObject = new WaitForSeconds(WaitTime);

        while (Value > MinValue)
        {
            yield return(waitObject);

            OnCountEvent.Invoke();
            Value--;
        }

        yield return(waitObject);

        OnEndEvent.Invoke();
    }
Exemplo n.º 5
0
    private IEnumerator RunCounter() //used to be private Start()
    {
        var waitObject = new WaitForSeconds(WaitTime);

        while (Value > MinValue)
        {
            yield return(waitObject);

            OnCountEvent.Invoke(); //used to print value
            Value--;
        }

        yield return(waitObject);

        OnEndEvent.Invoke();
    }
Exemplo n.º 6
0
    private void RunEndAction()
    {
        switch (currentConversation.endAction)
        {
        case EndAction.CHOICE:
            dialogueUI.toggleChoices(true);
            state = DialogueState.WaitforChoice;
            break;

        default:
            dialogueUI.toggleDialogueBox(false);
            InConversation = false;
            OnEndEvent?.Invoke(currentTrigger);
            OnDialogueStatus?.Invoke(true);
            break;
        }
    }
Exemplo n.º 7
0
        void Update()
        {
            switch (currentState)
            {
            case States.Start:
                OnStartEvent.Invoke();
                break;

            case States.Playing:
                OnPlayingEvent.Invoke();
                break;

            case States.End:
                OnEndEvent.Invoke();
                break;
            }
        }
Exemplo n.º 8
0
    void Update()
    {
        switch (currentStates)
        {
        case states.Start:
            break;

        case states.Playing:
            break;

        case states.End:
            OnEndEvent.Invoke();
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Exemplo n.º 9
0
    IEnumerator Expand()
    {
        float time = 0;

        while (time < animationTime)
        {
            time += Time.deltaTime;
            float currentTime = time / animationTime;
            float alpha       = a.Evaluate(currentTime);
            _Sprite.color = new Color(_Sprite.color.r, _Sprite.color.g, _Sprite.color.b, alpha);
            yield return(0);
        }

        if (OnEndEvent != null)
        {
            OnEndEvent.Invoke();
        }
    }
Exemplo n.º 10
0
    private void Update()
    {
        switch (currentStates)
        {
        case States.Start:
            OnStartEvent.Invoke();
            break;

        case States.Playtime:
            OnPlayerEvent.Invoke();
            break;

        case States.End:
            OnEndEvent.Invoke();
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Exemplo n.º 11
0
    void Update()
    {
        switch (currentState)
        {
        case States.start:
            OnStartEvent.Invoke();
            break;

        case States.playing:
            OnPlayingEvent.Invoke();
            break;

        case States.end:
            OnEndEvent.Invoke();
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
    }