added emotes
This commit is contained in:
@@ -10,9 +10,20 @@ public class NetPlayer : NetworkBehaviour
|
||||
public override void OnStartLocalPlayer()
|
||||
{
|
||||
base.OnStartLocalPlayer();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// Count current NetPlayers in the scene
|
||||
|
||||
SetMyTeam(GameManager.MyTeam);
|
||||
if(Cupid.RoomPort == -1){
|
||||
//Without cupid, set the team to red
|
||||
bool cloneWorkspace = LoginManager.EditorWorkspaceLooksLikeClone();
|
||||
SetMyTeam(cloneWorkspace ? Team.Red : Team.Blue);
|
||||
|
||||
}else{
|
||||
SetMyTeam(GameManager.MyTeam);
|
||||
}
|
||||
#else
|
||||
SetMyTeam(GameManager.MyTeam);
|
||||
#endif
|
||||
TeamSpecificEffects.instance.SetTeamSpecificEffects(myTeam);
|
||||
}
|
||||
|
||||
@@ -42,6 +53,56 @@ public class NetPlayer : NetworkBehaviour
|
||||
public Vector2 startPosition;
|
||||
public float curPuckPullForce;
|
||||
|
||||
#region EMOTES
|
||||
public void SendTextEmote(string txtName){
|
||||
if(isServer){
|
||||
RpcSendTextEmote(txtName);
|
||||
ShowTextEmote(txtName);
|
||||
}else{
|
||||
CmdSendTextEmote(txtName);
|
||||
}
|
||||
}
|
||||
|
||||
[Command]
|
||||
void CmdSendTextEmote(string txtName){
|
||||
RpcSendTextEmote(txtName);
|
||||
ShowTextEmote(txtName);
|
||||
}
|
||||
|
||||
[ClientRpc]
|
||||
void RpcSendTextEmote(string txtName){
|
||||
ShowTextEmote(txtName);
|
||||
}
|
||||
|
||||
void ShowTextEmote(string txtName){
|
||||
GameCanvas.instance.ShowTextEmote(txtName, myTeam);
|
||||
}
|
||||
|
||||
|
||||
public void SendEmojiEmote(int id){
|
||||
if(isServer){
|
||||
RpcSendEmojiEmote(id);
|
||||
ShowEmojiEmote(id);
|
||||
}else{
|
||||
CmdSendEmojiEmote(id);
|
||||
}
|
||||
}
|
||||
|
||||
[Command]
|
||||
void CmdSendEmojiEmote(int id){
|
||||
RpcSendEmojiEmote(id);
|
||||
ShowEmojiEmote(id);
|
||||
}
|
||||
|
||||
[ClientRpc]
|
||||
void RpcSendEmojiEmote(int id){
|
||||
ShowEmojiEmote(id);
|
||||
}
|
||||
|
||||
void ShowEmojiEmote(int id){
|
||||
GameCanvas.instance.ShowEmojiEmote(id, myTeam);
|
||||
}
|
||||
#endregion
|
||||
|
||||
void Start(){
|
||||
if(isLocalPlayer){
|
||||
|
||||
Reference in New Issue
Block a user