diff --git a/Assets/PerfectWorld/Scripts/Boostrap/BoostrapSceneController.cs b/Assets/PerfectWorld/Scripts/Boostrap/BoostrapSceneController.cs index 668a6dd21d..9b9882fe21 100644 --- a/Assets/PerfectWorld/Scripts/Boostrap/BoostrapSceneController.cs +++ b/Assets/PerfectWorld/Scripts/Boostrap/BoostrapSceneController.cs @@ -17,7 +17,11 @@ namespace BrewMonster private void LoadNextScene() { +#if TESTFAST + SceneManager.LoadSceneAsync(_nextSceneName,LoadSceneMode.Additive); +#else SceneManager.LoadScene(_nextSceneName); +#endif } } } \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs b/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs index 46e401f0b8..a74a9fdf34 100644 --- a/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs +++ b/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Runtime.ConstrainedExecution; using System.Security.Cryptography; using System.Text; +using BrewMonster; using UnityEngine; public class CECHostMove @@ -144,6 +145,7 @@ public class CECHostMove } public void SendMoveCmd(in Vector3 vCurPos, in Vector3 vVel, int iMoveMode, bool bForceSend = false) { + Vector3 vMoveDir = vVel; float fSpeed = vMoveDir.magnitude; SendMoveCmd(vCurPos, fSpeed, iMoveMode, bForceSend); @@ -168,7 +170,6 @@ public class CECHostMove void SendMoveCmd(in Vector3 vCurPos, float fSpeed, int iMoveMode, bool bForceSend) { - if (m_bStop) { // m_CmdTimeCnt.Reset(); diff --git a/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs b/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs index c9ffcf2193..69bb49d6f9 100644 --- a/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs +++ b/Assets/PerfectWorld/Scripts/NPC/CECNPC.cs @@ -791,13 +791,15 @@ public class CECNPC : CECObject BMLogger.LogError($" CECNPC.QueueLoadNPCModel szModelFile= {szModelFile.ToLower()} "); var model = NPCBuilder.Instance.GetModelByPath(szModelFile.ToLower()); if (model == null) { + + model = GameObject.CreatePrimitive(PrimitiveType.Capsule); BMLogger.LogError($" CECNPC.QueueLoadNPCModel model == null szModelFile= {szModelFile} "); - return; } + } var monsterModel = Instantiate(model, transform); monsterModel.SetActive(true); var npcVisual = GetComponent(); - npcVisual.InitNPCEventDoneHandler(m_NPCInfo); + npcVisual?.InitNPCEventDoneHandler(m_NPCInfo); //QueueECModelForLoad(MTL_ECM_NPC, GetNPCInfo().nid, GetBornStamp(), GetServerPos(), szModelFile, tid); } diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs index 671afb6aa4..28a4e43a74 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs @@ -338,7 +338,7 @@ namespace CSNetwork //sss //BMLogger.LogError($"### GameDataSend: CMDID {pCmdHeader}"); int iHostID = _selectedRole.roleid; - BMLogger.LogError($"### GameDataSend: " + pCmdHeader); + // BMLogger.LogError($"### GameDataSend: " + pCmdHeader); switch (pCmdHeader) { diff --git a/Assets/PerfectWorld/Scripts/UI/Login/LoginScreenUI.cs b/Assets/PerfectWorld/Scripts/UI/Login/LoginScreenUI.cs index f4b026fe22..b1b8664cd5 100644 --- a/Assets/PerfectWorld/Scripts/UI/Login/LoginScreenUI.cs +++ b/Assets/PerfectWorld/Scripts/UI/Login/LoginScreenUI.cs @@ -55,6 +55,7 @@ namespace BrewMonster.UI _usernameInputField.text = "test004"; _passwordInputField.text = "123456"; } + if (Input.GetKeyUp(KeyCode.Tab)) { _usernameInputField.text = "test002"; @@ -74,7 +75,7 @@ namespace BrewMonster.UI PlayerPrefs.SetString("password", password); PlayerPrefs.Save(); await UnityGameSession.Login(username, password, OnLoginComplete); - _selectCharacterScreen.gameObject.SetActive(true); + _selectCharacterScreen.gameObject.SetActive(true); } /// @@ -88,6 +89,7 @@ namespace BrewMonster.UI BMLogger.LogError("Login failed"); return; } + UnityGameSession.GetRoleListAsync(OnGetRoleListComplete); } @@ -110,7 +112,7 @@ namespace BrewMonster.UI private void OnSelectRoleComplete(RoleInfo roleInfo) { - context.Post(_ => + context.Post(_ => { isDoneWorldRender = false; isDoneNPCRender = false; @@ -121,7 +123,15 @@ namespace BrewMonster.UI return; } }; - string nameScene = "NPCRender"; +#if TESTFAST + string nameScene = "LoginScene"; + SceneManager.UnloadSceneAsync(nameScene); + isDoneNPCRender = true; + isDoneWorldRender = true; + actLoadChar?.Invoke(); + UnityGameSession.EnterWorldAsync(roleInfo, OnEnterWorldComplete); +#else + string nameScene = "NPCRender"; UnityGameSession.Instance.LoadScene(nameScene, LoadSceneMode.Single, (value) => { isDoneNPCRender = value; @@ -135,8 +145,8 @@ namespace BrewMonster.UI UnityGameSession.EnterWorldAsync(roleInfo, OnEnterWorldComplete); }); +#endif }, null); - } private async void OnEnterWorldComplete() @@ -158,7 +168,7 @@ namespace BrewMonster.UI // _inventoryUI.DisplayInventory(inventoryData); //} - #if UNITY_EDITOR +#if UNITY_EDITOR private void OnValidate() { if (_usernameInputField == null) @@ -166,17 +176,19 @@ namespace BrewMonster.UI // find childrend with name "username" _usernameInputField = transform.Find("username").GetComponent(); } + if (_passwordInputField == null) { // find childrend with name "password" _passwordInputField = transform.Find("password").GetComponent(); } + if (_loginButton == null) { // find childrend with name "LoginBtn" _loginButton = transform.Find("LoginBtn").GetComponent