// Use this for initialization void Start() { musicManager = GameObject.FindObjectOfType <musicManager>(); volumeSlider.value = PlayerPrefsManger.GetMasterVolume(); difficultySlider.value = PlayerPrefsManger.GetDifficulty(); //SFXSlider.value = PlayerPrefsManger.GetSFX(); }
void Awake(){ if (instance != null && instance != this) { Destroy (this.gameObject); return; } else { instance = this; } DontDestroyOnLoad (this.gameObject); }
private void Start() { if (name == "MilkButton") { btn = transform.GetChild(0).gameObject; btn.SetActive(false); } spriteManager = GameObject.FindGameObjectWithTag("SpriteManager").GetComponent <spriteManager>(); musicManager = GameObject.FindGameObjectWithTag("MusicManager").GetComponent <musicManager>(); parentMachine = transform.parent.GetComponent <machine>(); //machine of the holder }
void Start() { music = FindObjectOfType <musicManager>(); if (music.GetComponent <AudioSource>().clip != Clip) { music.FadeOutAS(); } else { alreadyPlaying = true; } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; DontDestroyOnLoad(gameObject); } Application.targetFrameRate = 60; }
private void Awake() { music = this; }
private void Awake() { _instance = this; }
void Awake() { m_instance = this; }
// Use this for initialization void Start() { manager = GameObject.Find("LocalAvatar").GetComponent <musicManager>(); }