Esempio n. 1
0
        public override void EnterGameHandler()
        {
            base.EnterGameHandler();

#if LOG_DISABLED
            Debug.unityLogger.logEnabled = false;
#endif

            IModular[] modulars = new ApplicationModular[]
            {
                new GameDataModular(),
                new BattleModular(),
                new BattleCardModular(),
                new BattleHeroModular(),
                new BattleAIModular(),
            };

            ShipDockApp shipDockApp            = ShipDockApp.Instance;
            GameObject  configableItems        = shipDockApp.ABs.GetAndQuote <GameObject>("is_king_main/configables", "ConfigableItems", out _);
            ConfigableItemsComponent component = configableItems.GetComponent <ConfigableItemsComponent>();

            InitConfigables(ref component);

            Consts.D_PLAYER.GetData <PlayerData>().InitPlayer();

            shipDockApp.AppModulars.AddModular(modulars);
            shipDockApp.AppModulars.NotifyModular(Consts.N_START_BATTLE);
        }
Esempio n. 2
0
        public void Add(IServer server)
        {
            if (mServerMapper == null)
            {
                return;
            }
            if (!IsInited)
            {
                IsInited = true;
                OnInit?.Invoke();
                OnInit = default;
            }
            string serverName = (server != null) ? server.ServerName : string.Empty;

            if (!string.IsNullOrEmpty(serverName) && !mServerMapper.IsContainsKey(serverName))
            {
                SetAndInitServer(ref server);
                SetServerPriority(server);
                mNewServers.Add(server);

                if (!mCanCheckServers)
                {
                    mCanCheckServers = true;
                    ShipDockApp.CallLater(CheckServerList);
                }
                mServerPriorAttrs = null;
            }
        }
Esempio n. 3
0
        private void CreateComponents()
        {
            ShipDockApp app        = ShipDockApp.Instance;
            var         components = app.Components;

            components.Create <RoleMustComponent>(FWConsts.COMPONENT_ROLE_MUST);
            components.Create <FWRoleCampComponent>(FWConsts.COMPONENT_ROLE_CAMP);
            components.Create <FWUserInputComponent>(FWConsts.COMPONENT_ROLE_INPUT);
            components.Create <PositionComponent>(FWConsts.COMPONENT_POSITION);
            components.Create <RoleNormalEnterSceneBehavior>(FWConsts.COMPONENT_ROLE_NORMAL_ENTER_SCENE);
            components.Create <RoleColliderComponent>(FWConsts.COMPONENT_ROLE_COLLIDER);
        }
Esempio n. 4
0
        private void OnShipDockStart()
        {
            Tester.Instance.SetDefaultTester(FWTester.Instance);
            Tester.Instance.Init(FWTester.Instance);
            Tester.Instance.Log(FWTester.LOG0, "ShipDock start up..");

            ShipDockConsts.NOTICE_SCENE_UPDATE_READY.Add(OnSceneUpdateReady);

            ShipDockApp app = ShipDockApp.Instance;

            app.AddStart(OnAppStarted);

            Servers servers = app.Servers;

            servers.OnInit += OnServersInit;
            servers.Add(new FWServer());
            servers.Add(new FWDataServer());
            servers.Add(new FWComponentServer());
            servers.Add(new FWCamerasServer());
            servers.AddOnServerFinished(OnFinished);
        }
Esempio n. 5
0
        /// <summary>
        /// 检测需要初始化的新容器
        /// </summary>
        private void CheckServerList(int time)
        {
            Utils.CloneFrom(ref mServersWillCheck, ref mNewServers, true);

            int max = mServersWillCheck.Count;

            if (max > 0)
            {
                IServer server = null;
                for (int i = 0; i < max; i++)
                {
                    server = mServersWillCheck[i];
                    if (server != null)
                    {
                        mServersWillSort.Add(server);
                    }
                }
            }
            mServersWillCheck.Clear();
            mCanCheckServers = false;

            ShipDockApp.CallLater(SortServersByPriority);
        }
Esempio n. 6
0
        private void OnServersInit()
        {
            ShipDockApp app = ShipDockApp.Instance;

            app.Servers.AddResolvableConfig(FWConsts.ServerConfigs);
        }
Esempio n. 7
0
 void Start()
 {
     ShipDockApp.StartUp(120, OnShipDockStart);
 }
Esempio n. 8
0
 private void OnDestroy()
 {
     ShipDockApp.Close();
 }
Esempio n. 9
0
 void Start()
 {
     ShipDockApp.StartUp(120);
 }