private void Awake() { // 获取Entitas的上下文对象,类似一个单例管理器 __contexts = Contexts.sharedInstance; // 获取所需的System组 __systems = new Feature("Systems") .Add(new GameFeature(__contexts)) .Add(new InputFeature(__contexts)) .Add(new UIFeature(__contexts)); stageRoot = new GameObject("StageRoot"); stageRoot.transform.SetParent(gameObject.transform, true); { mapRoot = new GameObject("MapRoot"); mapRoot.transform.SetParent(stageRoot.transform, true); heroRoot = new GameObject("HeroRoot"); heroRoot.layer = 10; heroRoot.transform.SetParent(stageRoot.transform, true); bossRoot = new GameObject("BossRoot"); bossRoot.transform.SetParent(stageRoot.transform, true); mobRoot = new GameObject("MobRoot"); mobRoot.transform.SetParent(stageRoot.transform, true); bulletRoot = new GameObject("BulletRoot"); bulletRoot.transform.SetParent(stageRoot.transform, true); propRoot = new GameObject("PropRoot"); propRoot.transform.SetParent(stageRoot.transform, true); wingmanRoot = new GameObject("WingmanRoot"); wingmanRoot.transform.SetParent(stageRoot.transform, true); } entityFactoryMap = new Dictionary <EEntityType, BaseEntityFactory>(); ObjectEmitManager.GetInstance().SetHandler(new EntityEmitListener()); }
private void Awake() { ObjectEmitManager.GetInstance().UpdateRandom(randomRoot); }