Пример #1
0
    private void OnCollisionEnter(Collision other)
    {
        if (_state == State.Dead || _state == State.LevelComplete || varColliderDisabler.GetBool())
        {
            return;
        }

        if (!other.gameObject.CompareTag("Friendly") && !other.gameObject.CompareTag("Finish"))
        {
            _state = State.Dead;
            HandleAudio();
            HandleMainThruster();
            HandleDeath();
            playerDeathEvent.RaiseEvent();
        }
        else if (other.gameObject.CompareTag("Finish"))
        {
            if (isAllStarsCollected.GetBool())
            {
                _state = State.LevelComplete;
                HandleAudio();
                HandleMainThruster();
                HandleLevelComplete();
                playerAtLvlEndEvent.RaiseEvent();
            }
        }
    }
Пример #2
0
    // methods
    private void ProcessDebugKeys()
    {
        if (Debug.isDebugBuild)
        {
            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                StartCoroutine(SceneLoader.LoadFirstLevel(0));
            }
            if (Input.GetKeyDown(KeyCode.L))
            {
                StartCoroutine(SceneLoader.LoadNextLevel(0));
            }

            if (Input.GetKeyDown(KeyCode.C))
            {
                varColliderDisabler.SetBool(!varColliderDisabler.GetBool());
            }
        }
    }