Created
July 4, 2015 13:29
-
-
Save minghanbai/c39d579ecb10de71a69b to your computer and use it in GitHub Desktop.
Revisions
-
smallrice45 created this gist
Jul 4, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ using UnityEngine; using System.Collections; using System.Collections.Generic; public class DataManager : MonoBehaviour { public delegate void DataLoaderHandler(); public event DataLoaderHandler onLoaderComplete; void Start(){ DoSomething(); } void DoSomething (){ OnLoaderComplete(); } void OnLoaderComplete (){ if (onLoaderComplete != null){ onLoaderComplete (); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ using UnityEngine; using System.Collections; using System.Collections.Generic; public class EventTriggerManager : MonoBehaviour { private DataManager m_DataManager; void Start(){ m_DataManager = GetComponent<DataManager>(); m_DataManager.onLoaderComplete += LoadDataToManager; } // Use this for initialization public void LoadDataToManager () { // DoSomething Debug.Log("LoadDataToManager"); } }