fix: 优化设备共享用户页面头像展示逻辑与UI细节
1. 简化头像加载判断逻辑,移除无头像时的调试日志和隐藏头像遮罩的冗余代码 2. 更新个人页面背景颜色为深灰色 3. 完善设备信息页面的头像项UI布局和资源替换,修复遮罩显示问题
This commit is contained in:
parent
077862d3c5
commit
17c63802f3
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 6.7 KiB |
@ -1114,6 +1114,7 @@ RectTransform:
|
|||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 7495942152176777622}
|
- {fileID: 7495942152176777622}
|
||||||
|
- {fileID: 8779463444013761852}
|
||||||
m_Father: {fileID: 569951927328174952}
|
m_Father: {fileID: 569951927328174952}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0.5}
|
m_AnchorMin: {x: 0, y: 0.5}
|
||||||
@ -1149,7 +1150,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 61a999e89cf12744eabe81892fe28323, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 9a825476c97d8e54faa98312fdb09c0d, type: 3}
|
||||||
m_Type: 0
|
m_Type: 0
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
@ -1171,7 +1172,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_ShowMaskGraphic: 1
|
m_ShowMaskGraphic: 0
|
||||||
--- !u!1 &7766080973714993289
|
--- !u!1 &7766080973714993289
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1204,10 +1205,10 @@ RectTransform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 8442496279164481652}
|
m_Father: {fileID: 8442496279164481652}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 100, y: 100}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &5443839381177704723
|
--- !u!222 &5443839381177704723
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
@ -1237,7 +1238,82 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 0}
|
m_Sprite: {fileID: 21300000, guid: 0d079f740e6e9bf47a72b22445bc71cb, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
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 &7811884068231423397
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 8779463444013761852}
|
||||||
|
- component: {fileID: 4404693549611109886}
|
||||||
|
- component: {fileID: 1100500817460275544}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Image
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &8779463444013761852
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7811884068231423397}
|
||||||
|
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_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 8442496279164481652}
|
||||||
|
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: 4, y: 4}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &4404693549611109886
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7811884068231423397}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &1100500817460275544
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7811884068231423397}
|
||||||
|
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.121568635, g: 0.1254902, b: 0.12941177, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 0e697e74c1568e34d902300a05cbeb88, type: 3}
|
||||||
m_Type: 0
|
m_Type: 0
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
|
|||||||
@ -2945,7 +2945,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
m_Color: {r: 0.09019608, g: 0.09019608, b: 0.09019608, a: 1}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
|
|||||||
@ -77,15 +77,8 @@ namespace Kill.UI.Pages
|
|||||||
item.transform.Find("昵称").GetComponent<Text>().text = user.user_name;
|
item.transform.Find("昵称").GetComponent<Text>().text = user.user_name;
|
||||||
item.transform.Find("分享时间").GetComponent<Text>().text = shareTimeString + user.share_time.ToString("yyyy-MM-dd HH:mm");
|
item.transform.Find("分享时间").GetComponent<Text>().text = shareTimeString + user.share_time.ToString("yyyy-MM-dd HH:mm");
|
||||||
Image image = item.transform.Find("头像遮罩").Find("头像").GetComponent<Image>();
|
Image image = item.transform.Find("头像遮罩").Find("头像").GetComponent<Image>();
|
||||||
if (string.IsNullOrEmpty(user.avatar))
|
if (!string.IsNullOrEmpty(user.avatar))
|
||||||
{
|
{
|
||||||
Debug.Log("用户 " + user.user_name + " 没有头像,使用默认头像");
|
|
||||||
image.gameObject.SetActive(false);
|
|
||||||
image.GetComponentInParent<Mask>().showMaskGraphic = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Log("用户 " + user.user_name + " 有头像,加载头像");
|
|
||||||
image.gameObject.SetActive(true);
|
image.gameObject.SetActive(true);
|
||||||
image.GetComponentInParent<Mask>().showMaskGraphic = false;
|
image.GetComponentInParent<Mask>().showMaskGraphic = false;
|
||||||
NetworkCtrl.Instance.LoadImageToUIImageAsync(user.avatar, image);
|
NetworkCtrl.Instance.LoadImageToUIImageAsync(user.avatar, image);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user