Пример #1
0
 private void OnEnd()
 {
     Task task = Task.Factory.StartNew(() =>
     {
         OnEndEvent?.Invoke();
     }
                                       );
 }
Пример #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();
            }
        }
    }
Пример #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();
    }
Пример #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();
    }
Пример #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;
        }
    }
Пример #7
0
        void Update()
        {
            switch (currentState)
            {
            case States.Start:
                OnStartEvent.Invoke();
                break;

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

            case States.End:
                OnEndEvent.Invoke();
                break;
            }
        }
Пример #8
0
    void Update()
    {
        switch (currentStates)
        {
        case states.Start:
            break;

        case states.Playing:
            break;

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

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Пример #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();
        }
    }
Пример #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();
        }
    }
Пример #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();
        }
    }
Пример #12
0
 public void SetMovePositionCallBack(Vector3 _pos, OnEndEvent CallBackFunction)
 {
     callbackFct = CallBackFunction;
     StartCoroutine("MoveNewPosition", _pos);
 }