public void Awake() { StartConfig startConfig = StartConfigComponent.Instance.StartConfig; this.HttpConfig = startConfig.GetComponent <HttpConfig>(); this.Load(); }
public void Awake(StartConfig allConfig, long id) { Instance = this; this.AllConfig = allConfig; this.AllConfig.Parent = this; // 每个进程的配置 foreach (StartConfig s in this.AllConfig.List) { s.SceneInstanceId = (s.Id << IdGenerater.HeadPos) + s.Id; if (s.Id == id) { this.StartConfig = s; } InnerConfig innerConfig = s.GetComponent <InnerConfig>(); if (innerConfig != null) { this.innerAddressDict.Add(s.Id, innerConfig.Address); } // 每个进程里面domain的配置 foreach (StartConfig startConfig in s.List) { startConfig.SceneInstanceId = (startConfig.Parent.Id << IdGenerater.HeadPos) + startConfig.Id; this.configDict.Add(startConfig.Id, startConfig); SceneConfig sceneConfig = startConfig.GetComponent <SceneConfig>(); switch (sceneConfig.SceneType) { case SceneType.Gate: this.Gates.Add(startConfig); break; case SceneType.Map: this.nameDict.Add(sceneConfig.Name, startConfig); break; default: this.typeDict.Add((int)sceneConfig.SceneType, startConfig); break; } } } }
public override void Dispose() { if (this.IsDisposed) { return; } base.Dispose(); Instance = null; this.configDict.Clear(); this.innerAddressDict.Clear(); this.Gates.Clear(); this.Agents.Clear(); this.typeDict.Clear(); this.nameDict.Clear(); this.StartConfig = null; }
public void Remove(StartConfig startConfig) { this.List.Remove(startConfig); }
public void Add(StartConfig startConfig) { startConfig.parent = this; this.List.Add(startConfig); }