コード例 #1
0
    public void DecreaseRainState()
    {
        switch (rState)
        {
        case RainState.off:
            break;

        case RainState.soft:
            rState = RainState.off;
            break;

        case RainState.medium:
            rState = RainState.soft;
            break;

        case RainState.heavy:
            rState = RainState.medium;
            break;

        case RainState.thunderStorm:
            rState = RainState.heavy;
            break;
        }
        Rain();
    }
コード例 #2
0
    void Update()
    {
        switch (currentState)
        {
        case RainState.raining:
        {
            Rain();

            if (rainCountdown <= 0)
            {
                notRainingCountDown = Random.Range(randomCountMin, randomCountMax);
                currentState        = RainState.notRaining;
            }

            MoveWithPlayer();

            break;
        }

        case RainState.notRaining:
        {
            StopRain();

            if (notRainingCountDown <= 0)
            {
                rainCountdown = Random.Range(randomCountMin, randomCountMax);
                currentState  = RainState.raining;
            }

            break;
        }
        }
    }
コード例 #3
0
        public void BeginDrying()
        {
            Log.Debug("Beginning drying cycle");

            Dry(_raining);

            State = RainState.Drying;
        }
コード例 #4
0
    private void Start()
    {
        player          = PlayerManager.instance.player.transform;
        rainObject      = GetComponent <ParticleSystem>();
        rainAudioSource = GetComponent <AudioSource>();

        //start values for the rain and not rain countdowns
        rainCountdown       = Random.Range(randomCountMin, randomCountMax);
        notRainingCountDown = Random.Range(randomCountMin, randomCountMax);

        //start with no rain
        currentState = RainState.notRaining;
    }
コード例 #5
0
        private void Reset()
        {
            Reset(_raining);
            Reset(_drying);
            Reset(_retired);
            Reset(_dead);

            foreach (var decal in GetComponentsInChildren <WetDecal>())
            {
                DestroyImmediate(decal.gameObject);
            }

            State = RainState.Drying;
        }
コード例 #6
0
        public void BeginRaining(float initialProgress = 0)
        {
            Log.Debug("Beginning raining cycle");

            Retire(_drying);
            Retire(_raining);

            var decal = Spawn();

            if (decal != null)
            {
                decal.Rain(initialProgress);
                _raining.Add(decal);
            }

            State = RainState.Raining;
        }
コード例 #7
0
    public IEnumerator PlayerDeath(float timer, Vector3 playerPosition)
    {
        while (timer > 0)
        {
            rState = RainState.off;
            Rain();
            globalLightObj.SetActive(false);
            if (SkullAI.sAI != null)
            {
                SkullAI.sAI.gameObject.SetActive(false);
            }
            lanternLight.pointLightInnerRadius = Mathf.Lerp(lanternLight.pointLightInnerRadius, 0f, Time.deltaTime * 2f);
            lanternLight.pointLightOuterRadius = Mathf.Lerp(lanternLight.pointLightOuterRadius, 0f, Time.deltaTime * 2f);
            timer -= Time.deltaTime;
            yield return(null);
        }

        AudioController.aC.PlaySFXAtPoint(AudioController.aC.playerDeath, playerPosition, 0.4f);

        yield return(new WaitForSeconds(4f));

        GameController.gC.RestartScene();
    }