private void Start()
 {
     skybox = Toolbox.Instance.GetPlayer().GetComponent <SkyboxTransition>();
     normalFogMultiplier = skybox.fogMultiplier;
     normalAmbMultipliet = skybox.ambientMultiplier;
     fog           = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.GlobalFog>();
     normalDensity = RenderSettings.fogDensity;
     player        = Toolbox.Instance.GetPlayer().transform;
     active        = false;
     skybox.AdMembrane(this);
 }
Example #2
0
    void Awake()
    {
        if (m_instance == null)
        {
            m_instance = this;
        }

        currentHours          = (int)(m_dayStartTime / 100);
        currentMinutes        = (int)(m_dayStartTime % 100);
        myTimeScaleStartValue = m_timeScale;

        //m_skybox = this.gameObject.AddComponent<SkyBoxBehavior>();
        //m_skybox.SetSkyBoxes(m_dayStartTime);
        m_skybox = this.gameObject.AddComponent <SkyboxTransition>();
        m_skybox.InitSkyboxTransition(currentHours);
    }
Example #3
0
 private void Start()
 {
     skybox = Toolbox.Instance.GetPlayer().GetComponent <SkyboxTransition>();
     fog    = Camera.main.GetComponent <UnityStandardAssets.ImageEffects.GlobalFog>();
 }
Example #4
0
    public void SetSettings(WorldSettings settingsObject)
    {
        SkyboxTransition skyboxSettings = player.GetComponent <SkyboxTransition>();

        skyboxSettings.DeactivateMembranes();

        if (skyboxSettings)
        {
            if (settingsObject.GetSkyBoxMaterial())
            {
                RenderSettings.skybox   = settingsObject.GetSkyBoxMaterial();
                skyboxSettings.material = settingsObject.GetSkyBoxMaterial();

                if (PlayerInReal())
                {
                    skyboxSettings.material.SetFloat("_TransitionState", 0f);
                }
                else
                {
                    skyboxSettings.material.SetFloat("_TransitionState", 1f);
                }
            }

            skyboxSettings.laserFog     = settingsObject.GetLaserFog();
            skyboxSettings.laserAmbient = settingsObject.GetLaserAmbient();
            skyboxSettings.realFog      = settingsObject.GetRealFog();
            skyboxSettings.realAbmient  = settingsObject.GetRealAmbient();

            skyboxSettings.ambientMultiplier = 1f;
            skyboxSettings.fogMultiplier     = 1f;

            skyboxSettings.ResetFog();

            if (settingsObject.GetRealGlobalParticle())
            {
                skyboxSettings.realGlobalParticle = settingsObject.GetRealGlobalParticle();
            }

            if (settingsObject.GetLaserGlobalParticle())
            {
                skyboxSettings.laserGlobalParticle = settingsObject.GetLaserGlobalParticle();
            }
        }

        if (flipScript)
        {
            flipScript.canFlip = settingsObject.GetPlayerCanSwitch();
        }

        SoundTrackManager soundtrack = player.GetComponentInChildren <SoundTrackManager>();



        if (soundtrack)
        {
            soundtrack.flipClip = settingsObject.GetFlipClip();
            soundtrack.mute     = !settingsObject.GetSoundtrackEnabled();
        }

        if (settingsObject.MuteOpeningSoundtrack())
        {
            if (soundtrack)
            {
                soundtrack.dynamicVolume = 1f;
            }
            if (TriggeredAudio.Instance)
            {
                TriggeredAudio.Instance.mute = true;
            }
            if (OpeningSongSingleton.Instance)
            {
                OpeningSongSingleton.Instance.mute = true;
            }
        }

        //else
        //{
        //    if (TriggeredAudio.Instance)
        //        TriggeredAudio.Instance.mute = false;
        //    if (OpeningSongSingleton.Instance)
        //        OpeningSongSingleton.Instance.mute = false;
        //}

        Instance.EnablePlayerMovementAndFlip(true);
    }
Example #5
0
 private void Start()
 {
     sky = Toolbox.Instance.GetPlayer().GetComponent <SkyboxTransition>();
 }