void Awake() { if (singleton == null) { singleton = this; } else if (singleton != this) { Destroy(this); } }
// Use this for initialization void Awake() { if (singleton == null) { singleton = this; } else if (singleton != this) { Destroy(gameObject); } audioClipPool = new List <k514AudioSource>(); }
void Start() { BulletMgr = k514BulletManager.singleton; MathMgr = k514MathManager.singleton; InteractMgr = k514InteractManager.singleton; EnemyMgr = k514EnemyManager.singleton; BlockMgr = k514StageBlockManager.singleton; ItemMgr = k514ItemManager.singleton; GameMgr = k514GamePlayManager.singleton; UI_SpecaMgr = k514UISpellCardManager.singleton; SerifuMgr = k514SerifuManager.singleton; SoundMgr = k514SoundManager.singleton; EffectMgr = k514EffectManager.singleton; OptionMgr = k514OptionManager.singleton; if (SoundMgr == null) { Instantiate(snd).parent = transform; SoundMgr = k514SoundManager.singleton; } }
// Use this for initialization void Start() { // 1G SYSTEM_AUDIO_ANALYZER = k514AudioAnalyzer.singleton; SYSTEM_MATH_MANAGER = k514MathManager.singleton; SYSTEM_SPECTRUM_MANAGER = k514SpectrumManager.singleton; SYSTEM_PATTERN_MANAGER = k514PatternCatchManager.singleton; SYSTEM_YOUTUBE_DATA = AudioAnalyzePreset.singleton; SYSTEM_SOUND_MANAGER = k514SoundManager.singleton; SYSTEM_ENEMY_SPAWNER = k514EnemySpawner.singleton; SYSTEM_PATTERN_GENERATOR = k514PatternGenerator.singleton; // 2G SYSTEM_YOUTUBE_CONNECTOR = YoutubeSearcher.singleton; SYSTEM_YOUTUBE_MANAGER = k514YoutubeManager.singleton; Debug.Log("System Manager loaded"); }