Beispiel #1
0
        public void Awake()
        {
            StartConfig startConfig = StartConfigComponent.Instance.StartConfig;

            this.HttpConfig = startConfig.GetComponent <HttpConfig>();

            this.Load();
        }
Beispiel #2
0
        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;
                    }
                }
            }
        }
Beispiel #3
0
        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;
        }
Beispiel #4
0
 public void Remove(StartConfig startConfig)
 {
     this.List.Remove(startConfig);
 }
Beispiel #5
0
 public void Add(StartConfig startConfig)
 {
     startConfig.parent = this;
     this.List.Add(startConfig);
 }