コード例 #1
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #2
0
    private void Start()
    {
        musicManager   = GameObject.FindObjectOfType <MusicManager>();
        soundFXManager = GameObject.FindObjectOfType <SoundFXManager>();
        motionBlur     = camera.GetComponent <MotionBlur>();
        depthOfField   = camera.GetComponent <DepthOfField>();
        SSAO           = camera.GetComponent <ScreenSpaceAmbientOcclusion>();
        noiseAndGrain  = camera.GetComponent <NoiseAndGrain>();
        bloom          = camera.GetComponent <Bloom>();
        antiAliasing   = camera.GetComponent <Antialiasing>();
        fpsCap         = GameObject.FindObjectOfType <FPS_Cap>();

        musicScrollbar.value          = PlayerPrefsManager.GetMusicVolume();
        soundFXScrollbar.value        = PlayerPrefsManager.GetSoundFXVolume();
        motionBlurScrollbar.value     = PlayerPrefsManager.GetMotionBlur();
        depthOfFieldScrollbar.value   = PlayerPrefsManager.GetDepthOfField();
        SSAOScrollbar.value           = PlayerPrefsManager.GetSSAO();
        noiseAndGrainToggle.isOn      = PlayerPrefsManager.GetNoiseAndGrain();
        bloomToggle.isOn              = PlayerPrefsManager.GetBloom();
        antiAliasingDropdown.value    = PlayerPrefsManager.GetAntiAliasing();
        targetFrameRateDropdown.value = PlayerPrefsManager.GetTargetFramerate();
    }