Beispiel #1
0
        private void LateUpdate()
        {
            if (isDrunk)
            {
                this.drunkTimer += Time.deltaTime;
                if (drunkTimer >= DrunkDuration)
                {
                    this.isDrunk = false;
                    gameObject.GetComponent <Command.PlayerInput>().resetControls();
                    this.drunkTimer = 0.0f;
                }
            }

            if (IsAddicted)
            {
                AddictionIntervalTimer += Time.deltaTime;
                if (AddictionIntervalTimer >= AddictionIntervalDuration)
                {
                    gamePlayController.GameOverAddiction();
                }
            }

            if (gameObject.transform.position.x >= RightLevelBoundary)
            {
                OnPlayerReachedEndpoint();
            }
        }