|
|
@@ -169,16 +169,11 @@ public class RabbitHuntGameMode_OnlinePK : RabbitHuntGameMode, ChallengeGameMode
|
|
|
public bool gameEnd = false;
|
|
|
|
|
|
public void InitSocketPlayer(Action successCallback) {
|
|
|
- if (GameObject.Find("SocketPlayer") == null) {
|
|
|
- PKMatchingView.MoniMatchForTestInGameScene(() => {
|
|
|
- myPlayerIndex = GlobalData.playerIndexInRoom;
|
|
|
- if (successCallback != null) successCallback();
|
|
|
- });
|
|
|
- } else {
|
|
|
+ socketPlayer = SocketPlayer.NewInstance();
|
|
|
+ socketPlayer.onRoomReadyComplete = () => {
|
|
|
myPlayerIndex = GlobalData.playerIndexInRoom;
|
|
|
if (successCallback != null) successCallback();
|
|
|
- }
|
|
|
- socketPlayer = GameObject.Find("SocketPlayer").GetComponent<SocketPlayer>();
|
|
|
+ };
|
|
|
socketPlayer.onReceivePKGameData = onReceivePKGameData;
|
|
|
AutoSwitchBanUserControlBow();
|
|
|
JC.Unity.CoroutineStarter.Start(CheckAndUpload());
|