void OnDisable() { var swf_manager = SwfManager.GetInstance(false); if (swf_manager) { swf_manager.RemoveClip(this); } }
void OnEnable() { var swf_manager = SwfManager.GetInstance(true); if (swf_manager) { swf_manager.AddClip(this); } }
void OnDisable() { Stop(false); var swf_manager = SwfManager.GetInstance(false); if (swf_manager) { swf_manager.RemoveController(this); } }
void OnEnable() { var swf_manager = SwfManager.GetInstance(true); if (swf_manager) { swf_manager.AddController(this); } if (autoPlay && Application.isPlaying) { Play(false); } }
/// <summary> /// Get cached manager instance from scene or create it (if allowed) /// </summary> /// <returns>The manager instance</returns> /// <param name="allow_create">If set to <c>true</c> allow create</param> public static SwfManager GetInstance(bool allow_create) { if (!_instance) { _instance = FindObjectOfType <SwfManager>(); if (allow_create && !_instance) { var go = new GameObject("[SwfManager]"); _instance = go.AddComponent <SwfManager>(); } } return(_instance); }