void Awake() { if (Instance != null) { Debug.LogError("Multiple SpecialEffects objects created!"); } Instance = this; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// PRIVATE FUNCTIONS /// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Called on start of the game object to init variables /// </summary> void Awake() { // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of SoundEffectsManager!"); } Instance = this; OnLevelWasLoaded(0); }
private void Start() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
public void OnActivate() { if (isActivate) { return; } for (int i = 0; i < 4; i++) { foreach (var item in GameManager.singleton.SpecialEffects_Pools) { if (!item.gameObject.activeInHierarchy) { SpecialEffectsManager se = item.GetComponent <SpecialEffectsManager>(); if (se.SpecialEffectsCode == 4) { if (i == 0) { se.OnEndPlayingSpecialEffects(Platforms_1.position); } else if (i == 1) { se.OnEndPlayingSpecialEffects(Platforms_2.position); } else if (i == 2) { se.OnEndPlayingSpecialEffects(Platforms_3.position); } else if (i == 3) { se.OnEndPlayingSpecialEffects(Platforms_4.position); } break; } } } } gameObject.SetActive(true); StartCoroutine(StartCasting()); }
void Awake() { instance = this; }