Example #1
0
 // Use this for initialization
 void Start()
 {
     musicManager           = GameObject.FindObjectOfType <musicManager>();
     volumeSlider.value     = PlayerPrefsManger.GetMasterVolume();
     difficultySlider.value = PlayerPrefsManger.GetDifficulty();
     //SFXSlider.value        = PlayerPrefsManger.GetSFX();
 }
Example #2
0
	void Awake(){
		if (instance != null && instance != this) {
			Destroy (this.gameObject);
			return;
		} else {
			instance = this;
		}
		DontDestroyOnLoad (this.gameObject);
	}
Example #3
0
 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
 }
Example #4
0
 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);
 }
Example #6
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
            DontDestroyOnLoad(gameObject);
        }

        Application.targetFrameRate = 60;
    }
 private void Awake()
 {
     music = this;
 }
Example #8
0
 private void Awake()
 {
     _instance = this;
 }
Example #9
0
 void Awake()
 {
     m_instance = this;
 }
Example #10
0
 // Use this for initialization
 void Start()
 {
     manager = GameObject.Find("LocalAvatar").GetComponent <musicManager>();
 }