void Start() { bgmMG = GameObject.Find("BGMManager"); effectMg = GameObject.Find("EffectManager"); muMg = bgmMG.GetComponent <MusicManager>(); efMg = effectMg.GetComponent <EffectSoundManager>(); UIButton bguib = gameObject.AddComponent <UIButton>(); if (bguib.gameObject.name == "BgmPlus") { bguib.tweenTarget = GameObject.Find("BgmPlus"); EventDelegate.Set(bguib.onClick, muMg.BgmPlus); } if (bguib.gameObject.name == "BgmMinus") { bguib.tweenTarget = GameObject.Find("BgmMinus"); EventDelegate.Set(bguib.onClick, muMg.BgmMinus); } if (bguib.gameObject.name == "EffectPlus") { bguib.tweenTarget = GameObject.Find("EffectPlus"); EventDelegate.Set(bguib.onClick, efMg.EffectPlus); } if (bguib.gameObject.name == "EffectMinus") { bguib.tweenTarget = GameObject.Find("EffectMinus"); EventDelegate.Set(bguib.onClick, efMg.EffectMinus); } }
void Awake() { float t = Time.time * 100f; Random.InitState((int)t); if (EffectSoundManager.instance == null) { EffectSoundManager.instance = this; } }
void Start() { if (_iNstance == null) //_iNstance null일때 { _iNstance = this; //_iNstance 해당 _iNstance 로 한다 } else if (_iNstance != this) //_iNstance 생성되있다면 { Destroy(gameObject); //중복으로 생성하지 않게한다 } DontDestroyOnLoad(gameObject); //파괴되지않게 유지한다 audios = gameObject.GetComponent <AudioSource>(); effectVoulme = gameObject.GetComponent <AudioSource>().volume; LoadedEffect(); }
private void Awake() { soundManager = this; audioSource = gameObject.GetComponent <AudioSource>(); }