protected virtual void Awake() { Events events = new Events(); events.defineEvent(); EventDefine.subscribeEvent(this, "GAME_START", new System.Action <object[]>((parameters) => { gameStart((System.DateTime)parameters[0]); })); EventDefine.subscribeEvent(this, "GAME_OVER", new System.Action <object[]>((parameters) => { gameOver((System.DateTime)parameters[0]); })); //添加UIManager组件 if (FindObjectOfType <UIManager>() == null) { new GameObject("GameManager").AddComponent <UIManager>(); } //添加AssetManager组件 if (FindObjectOfType <AssetManager>() == null) { new GameObject("AssetManager").AddComponent <AssetManager>(); } }
protected virtual void Start() { EventDefine.CallEvent("GAME_START", System.DateTime.Now); }