void OnEnable()
 {
     if (GlobalVariables.Instance.GameState == GameStateEnum.Paused)
     {
         slowmoScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <SlowMotionCamera>();
         slowmoScript.StopPauseSlowMotion();
     }
 }
Пример #2
0
    // Use this for initialization
    void Awake()
    {
        slowMo                  = GetComponent <SlowMotionCamera>();
        browianMotion           = GetComponent <BrownianMotion>();
        browianInitialFrequency = browianMotion.positionFrequency;

        GlobalVariables.Instance.OnEndMode += () => positionOnPause = Vector3.zero;
        GlobalVariables.Instance.OnMenu    += () => positionOnPause = Vector3.zero;
    }
Пример #3
0
    void Awake()
    {
        StartCoroutine(OnGameStateChange(GameState));
        StartCoroutine(OnStartupDoneEvent());
        StartCoroutine(OnCocktailModes(selectedCocktailModes.Count));
        StartCoroutine(OnSequenceChangement(ModeSequenceType));
        StartCoroutine(OnEnvironementChromaChangement(environementChroma));

        SetupRewiredPlayers();

        ReInput.ControllerConnectedEvent    += (ControllerStatusChangedEventArgs obj) => UpdateGamepadList();
        ReInput.ControllerDisconnectedEvent += (ControllerStatusChangedEventArgs obj) => UpdateGamepadList();

        //OnPlaying += UpdateGamepadList;
        OnMenu += UpdateGamepadList;

        LoadModeManager.Instance.OnLevelUnloaded += UpdateGamepadList;

        OnPlaying     += () => SetMouseVisibility();
        OnRestartMode += () => SetMouseVisibility();
        OnPlaying     += UpdatePlayedModes;
        OnMenu        += () => Startup = StartupType.Wave;
        OnEndMode     += () => Startup = StartupType.Delayed;
        OnEnvironementChromaChange += SetPlayerMouseCursor;

        MenuManager.Instance.OnStartModeClick += UpdateGamepadList;
        MenuManager.Instance.OnStartModeClick += CreateAIs;

        SetPlayerMouseCursor();

        mainCamera         = GameObject.FindGameObjectWithTag("MainCamera");
        screenShakeCamera  = mainCamera.GetComponent <ScreenShakeCamera>();
        zoomCamera         = mainCamera.GetComponent <ZoomCamera>();
        dynamicCamera      = mainCamera.GetComponent <DynamicCamera>();
        menuCameraMovement = mainCamera.GetComponent <MenuCameraMovement>();
        slowMotionCamera   = mainCamera.GetComponent <SlowMotionCamera>();

        fixedDeltaTime   = Time.fixedDeltaTime;
        fixedDeltaFactor = 1 / fixedDeltaTime;

        GraphicsQualityManager.Instance.OnFixedDeltaTimeChange += (x) =>
        {
            fixedDeltaTime   = x;
            fixedDeltaFactor = 1 / fixedDeltaTime;
        };

        LoadEnvironementChroma();
    }
Пример #4
0
 void Start()
 {
     slowMotionCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <SlowMotionCamera>();
     movableScript    = transform.parent.GetComponent <MovableScript> ();
 }
    // Use this for initialization
    void Start()
    {
        postProcessProfile = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PostProcessingBehaviour>().profile;
        bloom            = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Bloom>();
        distorsion       = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <LensDistortionBlur>();
        rgbSplit         = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <RGBSplit>();
        slowMoVignetting = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ContrastVignette>();
        bcgScript        = FindObjectOfType <BrightnessContrastGamma>();
        slowmoScript     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <SlowMotionCamera>();
        browianMotion    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <BrownianMotion>();

        //Video
        brightnessSlider.onValueChanged.AddListener(Brightness);
        contrastSlider.onValueChanged.AddListener(Contrast);
        gammaSlider.onValueChanged.AddListener(Gamma);

        //Advanced
        antialiasingSlider.onValueChanged.AddListener(AntiAliasing);
        bloomSlider.onValueChanged.AddListener(Bloom);
        shadowsSlider.onValueChanged.AddListener(Shadows);

        ambiantOcclusionToggle.onValueChanged.AddListener((bool arg0) =>
        {
            postProcessProfile.ambientOcclusion.enabled = arg0;
            EnableApplyButton();
        });
        blurToggle.onValueChanged.AddListener((bool arg0) =>
        {
            postProcessProfile.motionBlur.enabled = arg0;
            EnableApplyButton();
        });
        grainToggle.onValueChanged.AddListener((bool arg0) =>
        {
            postProcessProfile.grain.enabled = arg0;
            EnableApplyButton();
        });
        vignettingToggle.onValueChanged.AddListener((bool arg0) =>
        {
            postProcessProfile.vignette.enabled = arg0;
            EnableApplyButton();
        });

        cameraMotionToggle.onValueChanged.AddListener((bool arg0) =>
        {
            browianMotion.enabled = arg0;
            browianMotionEnabled  = arg0;

            if (!arg0 && MenuManager.Instance.currentMenu != null)
            {
                GlobalVariables.Instance.menuCameraMovement.MenuPositionGraphics();
            }

            if (arg0)
            {
                GlobalVariables.Instance.menuCameraMovement.EnableBrowianMotion();
            }

            EnableApplyButton();
        });
        rgbToggle.onValueChanged.AddListener((bool arg0) =>
        {
            rgbSplit.enabled = arg0;
            EnableApplyButton();
        });
        distorsionToggle.onValueChanged.AddListener((bool arg0) =>
        {
            distorsion.enabled = arg0;
            EnableApplyButton();
        });
        slowMoVignettingToggle.onValueChanged.AddListener((bool arg0) =>
        {
            slowMoVignetting.enabled = arg0;
            EnableApplyButton();
        });


        if (PlayerPrefs.HasKey("QualityLevel"))
        {
            LoadData();
        }
        else
        {
            Reset();
            ResetAdvanced();
        }

        SaveData();

        applyButton.SetActive(false);
        apply = true;
    }
Пример #6
0
    void Start()
    {
        playlistCont.mixerChannel.audioMixer.SetFloat("LowPassWet", -80f);
        playlistCont.mixerChannel.audioMixer.SetFloat("HighPassWet", -80f);

        slowMo = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <SlowMotionCamera>();

        StartCoroutine(MusicVolumeChange());
        StartCoroutine(SoundsVolumeChange());
        StartCoroutine(MasterVolumeChange());

        GlobalVariables.Instance.OnStartMode += SetGamePlaylist;
        GlobalVariables.Instance.OnMenu      += SetMenuPlaylist;

        GlobalVariables.Instance.OnPlaying += ResetLowPass;
        GlobalVariables.Instance.OnPlaying += ResetHighPass;

        GlobalVariables.Instance.OnPause   += () => LowPass(pauseLowPass);
        GlobalVariables.Instance.OnEndMode += () => LowPass(gameOverLowPass);

        LoadModeManager.Instance.OnLevelLoaded   += StopAttractionRepulsionSounds;
        LoadModeManager.Instance.OnLevelUnloaded += StopAttractionRepulsionSounds;

        slowMo.OnSlowMotionStart += () => HighPass(sloMoHighPass);
        slowMo.OnSlowMotionStop  += ResetHighPass;

        OnMusicVolumeChange  += UpdateAudioSettings;
        OnSoundsVolumeChange += UpdateAudioSettings;
        OnMasterVolumeChange += UpdateAudioSettings;

        playlistCont.SongChanged += (newSongName) => currentSong.text = newSongName;

        gameMusicButton.onClick.AddListener(() =>
        {
            playLoadedMusics = false;
            SetGamePlaylist();
        });

        personalMusicButton.onClick.AddListener(() =>
        {
            playLoadedMusics = true;
            SetGamePlaylist();
        });


        if (Application.isEditor)
        {
            loadedMusicsPath = editorLoadedMusicsPath;
        }
        else
        {
            loadedMusicsPath = Application.dataPath + loadedMusicsPath;
        }

        if (!Directory.Exists(loadedMusicsPath))
        {
            Directory.CreateDirectory(loadedMusicsPath);
        }

        if (PlayerPrefs.HasKey("LoadedMusicsCount"))
        {
            LoadMusics(true);
        }

        SetGamePlaylist();

        initialAttractingVolume = MasterAudio.GetGroupVolume(attractingSounds[0]);
        initialRepulsingVolume  = MasterAudio.GetGroupVolume(repulsingSounds[0]);

        MuteAttractionRepulsionSounds();

        if (canTakeTime != null)
        {
            canTakeTime.SetActive(false);
        }

        if (nothingToLoad != null)
        {
            nothingToLoad.SetActive(false);
        }


        if (SceneManager.GetActiveScene().name != "Scene Testing")
        {
            CreateMusicsSongTitle();
        }

        if (PlayerPrefs.HasKey("LowPassEnabled") && SceneManager.GetActiveScene().name != "Scene Testing")
        {
            LoadPlayersPrefs();
        }

        UpdateAudioSettings();

        LowPass(pauseLowPass, 0.5f);

        //MasterAudio.StartPlaylist ("Game");
        //MasterAudio.TriggerRandomPlaylistClip ();
    }