Fixing func calling order
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using BrewMonster;
|
||||
using CSNetwork;
|
||||
using CSNetwork.Protocols;
|
||||
using CSNetwork.C2SCommand;
|
||||
using CSNetwork.Protocols.RPCData;
|
||||
using CSNetwork.Security;
|
||||
using System;
|
||||
@@ -122,16 +121,9 @@ namespace BrewMonster.Network
|
||||
{
|
||||
Instance._gameSession.SendChatData(cChannel, szMsg, iPack, iSlot);
|
||||
}
|
||||
public static void RequestInventoryAsync(Action callback = null)
|
||||
public static void RequestInventoryAsync(byte byPackage, Action callback = null)
|
||||
{
|
||||
Instance._gameSession.RequestInventoryAsync(callback);
|
||||
}
|
||||
|
||||
public static void RequestInventoryByPackageAsync(byte byPackage, Action callback = null)
|
||||
{
|
||||
var req = new gamedatasend();
|
||||
req.Data = C2SCommandFactory.CreateGetInventoryDetail(byPackage);
|
||||
SendProtocol(req, callback);
|
||||
Instance._gameSession.RequestInventoryAsync(byPackage, callback);
|
||||
}
|
||||
|
||||
public static void RequestAllInventoriesAsync(Action callback = null, params byte[] packages)
|
||||
@@ -153,7 +145,7 @@ namespace BrewMonster.Network
|
||||
|
||||
foreach (var p in packages)
|
||||
{
|
||||
RequestInventoryByPackageAsync(p, onOneDone);
|
||||
RequestInventoryAsync(p, onOneDone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,20 +99,6 @@ namespace BrewMonster.UI
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// now we have to enter the world
|
||||
UnityGameSession.SendProtocol(
|
||||
new enterworld()
|
||||
{
|
||||
Roleid = roleInfo.roleid,
|
||||
Provider_link_id = 0,
|
||||
L_timeout = 0,
|
||||
Localsid = 0,
|
||||
Locktime = 0,
|
||||
Settime = 0,
|
||||
Timeout = 0
|
||||
}
|
||||
);
|
||||
};
|
||||
string nameScene = "NPCRender";
|
||||
UnityGameSession.Instance.LoadScene(nameScene, LoadSceneMode.Single, (value) =>
|
||||
@@ -125,9 +111,11 @@ namespace BrewMonster.UI
|
||||
{
|
||||
isDoneWorldRender = value;
|
||||
actLoadChar?.Invoke();
|
||||
UnityGameSession.EnterWorldAsync(roleInfo, OnEnterWorldComplete);
|
||||
|
||||
});
|
||||
}, null);
|
||||
OnEnterWorldComplete();
|
||||
}, null);
|
||||
|
||||
}
|
||||
|
||||
private async void OnEnterWorldComplete()
|
||||
|
||||
@@ -20,12 +20,6 @@ public class GameController : MonoBehaviour
|
||||
if (instance == null)
|
||||
{
|
||||
instance = FindAnyObjectByType<GameController>();
|
||||
//if (instance == null)
|
||||
//{
|
||||
// var go = new GameObject("GameController");
|
||||
// instance = go.AddComponent<GameController>();
|
||||
// DontDestroyOnLoad(go);
|
||||
//}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
@@ -35,12 +29,7 @@ public class GameController : MonoBehaviour
|
||||
if(instance == null)
|
||||
{
|
||||
instance = this;
|
||||
//DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
//else if(instance != this)
|
||||
//{
|
||||
// Destroy(gameObject);
|
||||
//}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
||||
Reference in New Issue
Block a user