浏览代码

PopUI CR changes applied

/main/staging/error_UI_UX
当前提交
3f26c715
共有 13 个文件被更改,包括 210 次插入98 次删除
  1. 184
      Assets/Prefabs/UI/PopUpUI.prefab
  2. 54
      Assets/Scenes/mainScene.unity
  3. 5
      Assets/Scripts/Game/GameManager.cs
  4. 16
      Assets/Scripts/Infrastructure/LogHandler.cs
  5. 9
      Assets/Scripts/Infrastructure/LogHandlerSettings.cs
  6. 3
      Assets/TextMesh Pro/Fonts.meta.private.0
  7. 7
      Assets/TextMesh Pro/Fonts.meta.private.0.meta
  8. 3
      Assets/TextMesh Pro/Resources.meta.private.0
  9. 7
      Assets/TextMesh Pro/Resources.meta.private.0.meta
  10. 3
      Assets/TextMesh Pro/Shaders.meta.private.0
  11. 7
      Assets/TextMesh Pro/Shaders.meta.private.0.meta
  12. 3
      Assets/TextMesh Pro/Sprites.meta.private.0
  13. 7
      Assets/TextMesh Pro/Sprites.meta.private.0.meta

184
Assets/Prefabs/UI/PopUpUI.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &301446214325955290
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1279590530552176638}
m_Layer: 5
m_Name: PopupWindow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1279590530552176638
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 301446214325955290}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4665700881383069573}
- {fileID: 3256890482581035309}
- {fileID: 2974111728439300772}
m_Father: {fileID: 2974111728825125461}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 500, y: 200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1240283808304611976
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 501787549882841141}
- component: {fileID: 1482532413725326712}
- component: {fileID: 1401923646421682987}
m_Layer: 5
m_Name: ErrorCenter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &501787549882841141
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1240283808304611976}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4665700881383069573}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -10, y: -10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1482532413725326712
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1240283808304611976}
m_CullTransparentMesh: 1
--- !u!114 &1401923646421682987
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1240283808304611976}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.14150941, g: 0.14150941, b: 0.14150941, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1337554221253817537
GameObject:
m_ObjectHideFlags: 0

m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2974111728825125461}
m_Children:
- {fileID: 501787549882841141}
m_Father: {fileID: 1279590530552176638}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.5686275}
m_Color: {r: 0.8490566, g: 0.28435388, b: 0.28435388, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2974111728944057205}
m_Father: {fileID: 2974111728825125461}
m_Father: {fileID: 1279590530552176638}
m_SizeDelta: {x: 160, y: 30}
m_SizeDelta: {x: 160, y: 25}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &2974111728439300793
CanvasRenderer:

- component: {fileID: 2974111728825125418}
- component: {fileID: 2974111728825125419}
- component: {fileID: 2974111728825125460}
- component: {fileID: 1969158100312030839}
- component: {fileID: 682510267401884749}
m_Layer: 5
m_Name: PopUpUI
m_TagString: Untagged

m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4665700881383069573}
- {fileID: 3256890482581035309}
- {fileID: 2974111728439300772}
- {fileID: 1279590530552176638}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_SizeDelta: {x: 500, y: 200}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2974111728825125417
CanvasRenderer:

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_Name:
m_EditorClassIdentifier:
m_popupText: {fileID: 1837149117904640813}
--- !u!223 &1969158100312030839
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2974111728825125462}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &682510267401884749
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2974111728825125462}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 3
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &2974111728944057206
GameObject:
m_ObjectHideFlags: 0

m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7259832110018682064}
m_Father: {fileID: 2974111728825125461}
m_Father: {fileID: 1279590530552176638}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}

54
Assets/Scenes/mainScene.unity


m_Name:
m_EditorClassIdentifier:
m_editorLogVerbosity: 0
popUpPrefab: {fileID: 2974111728825125460, guid: 79d6084439b78bb4eaf5232cb953fd87, type: 3}
m_errorReactions:
- m_logMessageCallback:
m_popUpPrefab: {fileID: 2974111728825125460, guid: 79d6084439b78bb4eaf5232cb953fd87, type: 3}
m_reaction:
m_logMessageCallback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1095306255}

objectReference: {fileID: 0}
- target: {fileID: 326167899787007624, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 67.125
value: 0
value: -27.5
value: 0
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 117.125
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 383981310721364277, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_fontSize

objectReference: {fileID: 0}
- target: {fileID: 3650619398323029537, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 167.125
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3702807454233794544, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 0}
- target: {fileID: 8392415084811609826, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 217.125
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8397947723339444263, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_fontSize

5
Assets/Scripts/Game/GameManager.cs


private bool m_coolingDown;
/// <summary>Rather than a setter, this is usable in-editor. It won't accept an enum, however.</summary>
public void SetLobbyColorFilter(int color)
{
m_lobbyColorFilter = (LobbyColor)color;
}
public void SetLobbyColorFilter(int color){ m_lobbyColorFilter = (LobbyColor)color; }
private LobbyColor m_lobbyColorFilter;

16
Assets/Scripts/Infrastructure/LogHandler.cs


static LogHandler s_instance;
ILogHandler m_DefaultLogHandler = Debug.unityLogger.logHandler; // Store the default logger that prints to console.
List<ErrorReaction> m_errorReactions = new List<ErrorReaction>();
ErrorReaction m_reaction;
public static LogHandler Get()
{

return s_instance;
}
public void SetLogReactions(List<ErrorReaction> reactions)
public void SetLogReactions(ErrorReaction reactions)
m_errorReactions = reactions;
m_reaction = reactions;
}
public void LogFormat(LogType logType, Object context, string format, params object[] args)

private void LogReaction(Exception exception)
{
foreach (var reaction in m_errorReactions)
reaction.Filter(exception);
m_reaction?.Filter(exception);
/// <summary>
/// The idea here is to
/// </summary>
[Serializable]
public class ErrorReaction
{

{
string message = "";
var rawExceptionMessage = "";
//We want to Ensure the most relevant error message is on top
if (exception.InnerException != null)
rawExceptionMessage = exception.InnerException.ToString();

var firstLineIndex = rawExceptionMessage.IndexOf("\n");
var firstRelayString = rawExceptionMessage.Substring(0, firstLineIndex);
message = firstRelayString;
if (string.IsNullOrEmpty(message))
return;
m_logMessageCallback?.Invoke(message);

9
Assets/Scripts/Infrastructure/LogHandlerSettings.cs


using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
namespace LobbyRelaySample
{

private LogMode m_editorLogVerbosity = LogMode.Critical;
[SerializeField]
PopUpUI popUpPrefab;
private PopUpUI m_popUpPrefab;
List<ErrorReaction> m_errorReactions = new List<ErrorReaction>();
private ErrorReaction m_errorReaction;
LogHandler.Get().SetLogReactions(m_errorReactions);
LogHandler.Get().SetLogReactions(m_errorReaction);
var popupInstance = Instantiate(popUpPrefab, transform);
var popupInstance = Instantiate(m_popUpPrefab, transform);
popupInstance.ShowPopup(errorMessage, Color.red);
}
}

3
Assets/TextMesh Pro/Fonts.meta.private.0


fileFormatVersion: 2
guid: 077401255185464e9b7bb889ed8280e7
timeCreated: 1620062128

7
Assets/TextMesh Pro/Fonts.meta.private.0.meta


fileFormatVersion: 2
guid: 8562a96ab261c68478bc71961f545c2f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
Assets/TextMesh Pro/Resources.meta.private.0


fileFormatVersion: 2
guid: 017af257aa3d4ade9644309997be39de
timeCreated: 1620062128

7
Assets/TextMesh Pro/Resources.meta.private.0.meta


fileFormatVersion: 2
guid: 4a3fdb949a9746940af94101f709f04d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
Assets/TextMesh Pro/Shaders.meta.private.0


fileFormatVersion: 2
guid: 5915fb622e8b4e7a9815228d467e7167
timeCreated: 1620062115

7
Assets/TextMesh Pro/Shaders.meta.private.0.meta


fileFormatVersion: 2
guid: d6a8cd862f117884db82bd4017125774
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
Assets/TextMesh Pro/Sprites.meta.private.0


fileFormatVersion: 2
guid: 347d77b9f27146049993e70fd2c3ca78
timeCreated: 1620062128

7
Assets/TextMesh Pro/Sprites.meta.private.0.meta


fileFormatVersion: 2
guid: e58181612d0ba9d4da4aeafea973c347
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存