浏览代码

Renamed PlayerInteractionPanel to UserInteraction Panel.

Player should refer to in-game entities, and user should refer to in-lobby and other service entities.
/main/staging/december_UI_bugs
当前提交
57b494b0
共有 6 个文件被更改,包括 19 次插入1004 次删除
  1. 2
      Assets/Scripts/UI/UserNameUI.cs
  2. 20
      Assets/Scripts/Vivox/VivoxUserHandler.cs
  3. 1001
      Assets/Prefabs/UI/PlayerInteractionPanel.prefab
  4. 0
      /Assets/Prefabs/UI/UserInteractionPanel.prefab.meta
  5. 0
      /Assets/Scripts/UI/UserNameUI.cs.meta
  6. 0
      /Assets/Scripts/UI/UserNameUI.cs

2
Assets/Scripts/UI/UserNameUI.cs


/// <summary>
/// Displays the player's name.
/// </summary>
public class PlayerNameUI : ObserverPanel<LobbyUser>
public class UserNameUI : ObserverPanel<LobbyUser>
{
[SerializeField]
TMP_Text m_TextField;

20
Assets/Scripts/Vivox/VivoxUserHandler.cs


public void OnChannelJoined(IChannelSession channelSession) // Called after a connection is established, which begins once a lobby is joined.
{
//Check if we are muted or not
m_channelSession = channelSession;
m_channelSession.Participants.AfterKeyAdded += OnParticipantAdded;
m_channelSession.Participants.BeforeKeyRemoved += BeforeParticipantRemoved;

var source = (VivoxUnity.IReadOnlyDictionary<string, IParticipant>)sender;
var participant = source[keyEventArg.Key];
var username = participant.Account.DisplayName;
m_lobbyUserVolumeUI.EnableVoice(true);
if(!participant.IsMutedForAll)
m_lobbyUserVolumeUI.EnableVoice(false);//Should check if user is muted or not.
else
m_lobbyUserVolumeUI.DisableVoice(false);
}
else
{
if(!participant.LocalMute)
m_lobbyUserVolumeUI.EnableVoice(false);//Should check if user is muted or not.
else
m_lobbyUserVolumeUI.DisableVoice(false);
}
}
private void BeforeParticipantRemoved(object sender, KeyEventArg<string> keyEventArg)

1001
Assets/Prefabs/UI/PlayerInteractionPanel.prefab
文件差异内容过多而无法显示
查看文件

/Assets/Prefabs/UI/PlayerInteractionPanel.prefab.meta → /Assets/Prefabs/UI/UserInteractionPanel.prefab.meta

/Assets/Scripts/UI/PlayerNameUI.cs.meta → /Assets/Scripts/UI/UserNameUI.cs.meta

/Assets/Scripts/UI/PlayerNameUI.cs → /Assets/Scripts/UI/UserNameUI.cs

正在加载...
取消
保存