serverBuild
This commit is contained in:
@@ -132,12 +132,14 @@ public class invitePlayer : NetworkBehaviour
|
||||
if (ownerName.Length == 0)
|
||||
{
|
||||
inPartyUI.SetActive(false);
|
||||
charPartyText.text = "";
|
||||
charPartyUI.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
inPartyUI.SetActive(true);
|
||||
inPartyOwnerNameTxt.text = $"{ownerName}'s Party";
|
||||
inPartyOwnerNameTxt.text = charPartyText.text;
|
||||
charPartyText.text = $"in {ownerName}'s party";
|
||||
charPartyUI.SetActive(true);
|
||||
|
||||
playerNetwork[] players = FindObjectsOfType<playerNetwork>();
|
||||
@@ -154,9 +156,9 @@ public class invitePlayer : NetworkBehaviour
|
||||
}
|
||||
|
||||
public void LeaveParty(){
|
||||
//playerNetwork.localPlayer.CmdLeaveParty();
|
||||
playerNetwork.localPlayer.CmdLeaveParty();
|
||||
inPartyUI.SetActive(false);
|
||||
charPartyUI.SetActive(false);
|
||||
charPartyText.text = "";
|
||||
// charPartyUI.SetActive(false);
|
||||
// charPartyText.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,6 +281,12 @@ public class playerNetwork : NetworkBehaviour
|
||||
[Command]
|
||||
public void CmdAcceptInvite(string otherPlayerName){
|
||||
myPartyOwner = otherPlayerName;
|
||||
Debug.Log("Invite accepted: " + myPartyOwner);
|
||||
}
|
||||
|
||||
[Command]
|
||||
public void CmdLeaveParty(){
|
||||
myPartyOwner = null;
|
||||
}
|
||||
|
||||
playerNetwork FindPlayerByName(string playerName){
|
||||
@@ -447,6 +453,7 @@ public class playerNetwork : NetworkBehaviour
|
||||
invitePlayer.InParty(myPartyOwner);
|
||||
}else{
|
||||
invitePlayer.InParty("");
|
||||
|
||||
}
|
||||
}
|
||||
ShowXP();
|
||||
|
||||
Reference in New Issue
Block a user