public async void Start()
        {
            //初始化zstring
            using (zstring.Block()) { }

            LaunchUI.Init();
            List <Func <Task> > initFunctions = new List <Func <Task> >();

            //config
            initFunctions.Add(UILocationAsset.Refresh);
            initFunctions.Add(UICodeTextAsset.Refresh);
            initFunctions.Add(UINamesAsset.Refresh);
            initFunctions.Add(AtlasConfigAsset.Refresh);
            initFunctions.Add(UIConfigAsset.Refresh);
            initFunctions.Add(AudioConfigAsset.Refresh);
            initFunctions.Add(PrefabPathAsset.Refresh);
            initFunctions.Add(ModelConfigAsset.Refresh);
            //setting
            initFunctions.Add(HUDConfigAsset.Load);
            for (int i = 0; i < initFunctions.Count; i++)
            {
                await initFunctions[i].Invoke();
                LaunchUI.ShowProcess((float)(i + 1) / (float)initFunctions.Count * 0.5f);
            }

            SoundManager.Init();
            TcpManager.Init();
            MapManager.Init();
            AOIManager.Init();
            XLuaManager.Init();
            XLuaManager.Inject <GameSettings>("GameSettings", GameSettings);
            XLuaManager.StartGame();
            LuaLoadedTime = DateTime.UtcNow.Ticks;
        }
 private void FixedUpdate()
 {
     TcpManager.FixedUpdate();
     TimeManager.FixedUpdate();
     XLuaManager.FixedUpdate();
     EntityBehaviorManager.FixedUpdate();
 }
 private void Update()
 {
     InputManager.Update();
     TcpManager.Update();
     //TimeManager放在XLuaManager之后,保证OperationLuaTable即使0帧回收,也不会在XLuaUpdate里被利用
     XLuaManager.Update();
     TimeManager.Update();
     EntityBehaviorManager.Update();
     HUDManager.Update();
 }
 private async void OnApplicationQuit()
 {
     AtlasManager.Dispose();
     XLuaManager.Dispose();
     AOIManager.Dispose();
     TcpManager.Dispose();
     TimeManager.Dispose();
     MapManager.Dispose();
     HUDManager.Dispose();
     //why
     await Task.Delay(1);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 同步
 /// </summary>
 /// <param name="force">是否强制同步</param>
 public void SyncPos(bool force = false)
 {
     if (intervalFrame == syncFrame || force)
     {
         proto.trans.pos_x   = behavior.transform.position.x;
         proto.trans.pos_y   = behavior.transform.position.y;
         proto.trans.pos_z   = behavior.transform.position.z;
         proto.trans.forward = behavior.transform.eulerAngles.y;
         byte[] bys = proto.encode();
         TcpManager.SendBytes(msgId.c2s_sync_trans, bys);
         intervalFrame = 0;
     }
 }
Exemplo n.º 6
0
 public static void Dispose()
 {
     TcpManager.RemoveListener(msgId.s2c_aoi_trans);
 }
Exemplo n.º 7
0
 public static void Init()
 {
     TcpManager.AddListener(msgId.s2c_aoi_trans, Sync_Status);
 }