|
|
@@ -10,6 +10,7 @@ public class UserPlayer : JCEntity
|
|
|
public static UserPlayer ins;
|
|
|
public UserPlayer() {
|
|
|
ins = this;
|
|
|
+ components.Add("PKComp", PKComp.ins);
|
|
|
}
|
|
|
public static void ConnectServer() {
|
|
|
if (ins != null) return;
|
|
|
@@ -100,23 +101,4 @@ public class UserPlayer : JCEntity
|
|
|
Close();
|
|
|
}
|
|
|
}
|
|
|
- public void onInvitePK(int avatarID, string nickname, int roomID, int roomType) {
|
|
|
- string[] pkTypeNames = {"静止靶", "野兔闯关", "野鸡闯关", "野狼闯关"};
|
|
|
- string pkTypeName = pkTypeNames[roomType];
|
|
|
- string tip = $"好友邀请你参加{pkTypeName}PK";
|
|
|
- System.Action cb = delegate() {
|
|
|
- if (!PKMatchingView.ins && SceneManager.GetActiveScene().name == "Home") {
|
|
|
- PKMatchingView view = PKMatchingView.Create();
|
|
|
- view.isFriendPKInvitee = true;
|
|
|
- view.targetJoinRoomID = roomID;
|
|
|
- GlobalData.pkMatchType = PKMatchType.OnlinePK;
|
|
|
- GlobalData.matchRoomType = roomType;
|
|
|
- } else if (PKMatchingView.ins) {
|
|
|
- PopupMgr.ins.ShowTip("当前正处于匹配状态,无法接受好友PK邀请!");
|
|
|
- }
|
|
|
- };
|
|
|
- if (!PKMatchingView.ins && SceneManager.GetActiveScene().name == "Home") {
|
|
|
- PopupMgr.ins.ShowPKInviteNotice(avatarID, nickname, tip, cb);
|
|
|
- }
|
|
|
- }
|
|
|
}
|