浏览代码

addressed CR comments.

/main/staging/vivox_UI
当前提交
c06c142d
共有 5 个文件被更改,包括 41 次插入61 次删除
  1. 14
      Assets/Prefabs/UI/LogManager.prefab
  2. 42
      Assets/Scripts/Game/LobbyUser.cs
  3. 23
      Assets/Scripts/Game/LobbyUserAudio.cs
  4. 23
      Assets/Scripts/Game/LocalUserVolume.cs
  5. 0
      /Assets/Scripts/Game/LobbyUserAudio.cs.meta

14
Assets/Prefabs/UI/LogManager.prefab


m_errorReaction:
m_logMessageCallback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 8425041362224744845}
m_TargetAssemblyTypeName: LobbyRelaySample.LogHandlerSettings, LobbyRelaySample
m_MethodName: SpawnErrorPopup
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []

42
Assets/Scripts/Game/LobbyUser.cs


/// Used for limiting costly OnChanged actions to just the members which actually changed.
/// </summary>
[Flags]
public enum UserMembers
{
IsHost = 1,
DisplayName = 2,
Emote = 4,
ID = 8,
UserStatus = 16,
HasVoice = 32
public enum UserMembers{ IsHost = 1, DisplayName = 2, Emote = 4, ID = 8, UserStatus = 16, HasVoice = 32
//TODO Add in lobbyUsers Voice Activity for animation?
}

}
}
}
public string ID
public EmoteType Emote
get => m_data.ID;
get => m_data.Emote;
if (m_data.ID != value)
if (m_data.Emote != value)
m_data.ID = value;
m_lastChanged = UserMembers.ID;
m_data.Emote = value;
m_lastChanged = UserMembers.Emote;
public EmoteType Emote
public string ID
get => m_data.Emote;
get => m_data.ID;
if (m_data.Emote != value)
if (m_data.ID != value)
m_data.Emote = value;
m_lastChanged = UserMembers.Emote;
m_data.ID = value;
m_lastChanged = UserMembers.ID;
OnChanged(this);
}
}

{
UserData data = observed.m_data;
int lastChanged = // Set flags just for the members that will be changed.
(m_data.IsHost == data.IsHost ? 0 : (int)UserMembers.IsHost) |
(m_data.IsHost == data.IsHost ? 0 : (int)UserMembers.IsHost) |
(m_data.ID == data.ID ? 0 : (int)UserMembers.ID) |
(m_data.Emote == data.Emote ? 0 : (int)UserMembers.Emote) |
(m_data.UserStatus == data.UserStatus ? 0 : (int)UserMembers.UserStatus) |
(m_data.HasVoice == data.HasVoice ? 0 : (int)UserMembers.HasVoice);
(m_data.ID == data.ID ? 0 : (int)UserMembers.ID) |
(m_data.Emote == data.Emote ? 0 : (int)UserMembers.Emote) |
(m_data.UserStatus == data.UserStatus ? 0 : (int)UserMembers.UserStatus) |
(m_data.HasVoice == data.HasVoice ? 0 : (int)UserMembers.HasVoice);
if (lastChanged == 0) // Ensure something actually changed.
return;

23
Assets/Scripts/Game/LobbyUserAudio.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LobbyRelaySample
{
[SerializeField]
public class LobbyUserAudio
{
public string ID { get; private set; }
public bool HasVoice { get; set; }
public bool Muted { get; set; }
public float UserVolume { get; set; }
public LobbyUserAudio(string userID)
{
ID = userID;
HasVoice = false;
Muted = false;
UserVolume = 1;
}
}
}

23
Assets/Scripts/Game/LocalUserVolume.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LobbyRelaySample
{
[SerializeField]
public class LobbyUserAudio
{
public string ID { get; private set; }
public bool HasVoice;
public bool Muted;
public float UserVolume;
public LobbyUserAudio(string userID)
{
ID = userID;
HasVoice = false;
Muted = false;
UserVolume = 1;
}
}
}

/Assets/Scripts/Game/LocalUserVolume.cs.meta → /Assets/Scripts/Game/LobbyUserAudio.cs.meta

正在加载...
取消
保存