浏览代码

Added Disconnect/Reconnect Player Display Updating System

/main
andytouch 5 年前
当前提交
fc015205
共有 4 个文件被更改,包括 35 次插入13 次删除
  1. 20
      InputSystem_LocalMultiplayer_Project/Assets/Scenes/Scene_Example_Warriors.unity
  2. 4
      InputSystem_LocalMultiplayer_Project/Assets/Scripts/DeviceDisplayConfigurator.cs
  3. 2
      InputSystem_LocalMultiplayer_Project/Assets/Scripts/GameManager.cs
  4. 22
      InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerUIManager.cs

20
InputSystem_LocalMultiplayer_Project/Assets/Scenes/Scene_Example_Warriors.unity


m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 1381499504}
characterCount: 6
characterCount: 0
wordCount: 1
wordCount: 0
lineCount: 1
pageCount: 1
lineCount: 0
pageCount: 0
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1854239559}
m_Enabled: 1
m_Enabled: 0
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}

m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 2137092837}
characterCount: 19
characterCount: 0
spaceCount: 1
wordCount: 2
spaceCount: 0
wordCount: 0
lineCount: 1
pageCount: 1
lineCount: 0
pageCount: 0
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0

4
InputSystem_LocalMultiplayer_Project/Assets/Scripts/DeviceDisplayConfigurator.cs


}
public Color GetFallbackDisplayColor()
{
return fallbackDisplayColor;
}
}

2
InputSystem_LocalMultiplayer_Project/Assets/Scripts/GameManager.cs


{
MenuUIManager.Instance.ToggleMenu(newState);
if(additionalCameraData != null)
{
additionalCameraData.SetRenderer(newState? 1 : 0);

22
InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerUIManager.cs


GetPlayerInputID();
GetPlayerDeviceDisplayName();
GetPlayerDeviceDisplayColor();
SetDisplayText();
SetDeviceDisplayText();
}
void GetPlayerInputID()

currentDeviceColor = deviceDisplayConfigurator.GetDeviceDisplayColor(playerInput.devices[0].ToString());
}
void SetDisplayText()
void SetDeviceDisplayText()
}
void SetDisconnectedDisplayText()
{
playerDisplayText.SetText("Player: " + (currentPlayerID + 1) + "\n" + "Device Disconnected!");
playerDisplayText.color = new Color(1,1,1,1);
}
//Device Callbacks from the new Input System ----
private void OnDeviceLost()
{
SetDisconnectedDisplayText();
}
private void OnDeviceRegained()
{
SetDeviceDisplayText();
}
}
正在加载...
取消
保存