赛事角标刷新;处理弹窗层次问题
This commit is contained in:
parent
5a148c28a8
commit
50ad74bb09
63
Assets/ContentFitterController.cs
Normal file
63
Assets/ContentFitterController.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ContentFitterController : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
public void Refresh()
|
||||
{
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.GetComponent<RectTransform>());
|
||||
//Canvas.ForceUpdateCanvases();
|
||||
//HorizontalOrVerticalLayoutGroup layout = GetComponent<HorizontalLayoutGroup>();
|
||||
//if (layout)
|
||||
//{
|
||||
// UpdateRect(layout);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// layout = GetComponent<VerticalLayoutGroup>();
|
||||
// if (layout)
|
||||
// {
|
||||
// UpdateRect(layout);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
private void OnRectTransformDimensionsChange()
|
||||
{
|
||||
Debug.Log("cf刷新一次2");
|
||||
Refresh();
|
||||
}
|
||||
private IEnumerator UpdateRect()
|
||||
{
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.GetComponent<RectTransform>());
|
||||
yield return new WaitForSeconds(0.1F);
|
||||
var round = GetComponent<ImageWithIndependentRoundedCorners>();
|
||||
if (round)
|
||||
{
|
||||
round.Refresh();
|
||||
}
|
||||
}
|
||||
public void UpdateRect(HorizontalOrVerticalLayoutGroup layout)
|
||||
{
|
||||
if (layout is HorizontalLayoutGroup)
|
||||
{
|
||||
layout.SetLayoutHorizontal();
|
||||
}
|
||||
if (layout is VerticalLayoutGroup)
|
||||
{
|
||||
layout.SetLayoutVertical();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/ContentFitterController.cs.meta
Normal file
11
Assets/ContentFitterController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d832f1dc5650bd24b90dbd3efdc2780e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1560,7 +1560,7 @@ MonoBehaviour:
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_TargetGraphic: {fileID: 6531176937881363210}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
||||
@ -2638,6 +2638,9 @@ GameObject:
|
||||
- component: {fileID: 7041032684697079492}
|
||||
- component: {fileID: 4525673257888556191}
|
||||
- component: {fileID: 514663802465645756}
|
||||
- component: {fileID: 3928515986859718043}
|
||||
- component: {fileID: 7663415347928336954}
|
||||
- component: {fileID: 3048864467902794139}
|
||||
m_Layer: 5
|
||||
m_Name: Status
|
||||
m_TagString: Untagged
|
||||
@ -2692,7 +2695,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Texture: {fileID: 2800000, guid: 4214119458c589c409b03681f25e73d8, type: 3}
|
||||
m_Texture: {fileID: 0}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
@ -2738,6 +2741,44 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!114 &3928515986859718043
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7244434384299247192}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 109c41f08973846429af681aea0a30c4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
r: {x: 0, y: 10, z: 0, w: 10}
|
||||
rect2props: {x: 0.00000023841858, y: -0.0000011920929, z: 10.606603, w: 3.5355341}
|
||||
--- !u!225 &7663415347928336954
|
||||
CanvasGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7244434384299247192}
|
||||
m_Enabled: 1
|
||||
m_Alpha: 1
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!114 &3048864467902794139
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7244434384299247192}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d832f1dc5650bd24b90dbd3efdc2780e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &7610353052895165859
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -2125,6 +2125,7 @@ GameObject:
|
||||
- component: {fileID: 7321607841691860978}
|
||||
- component: {fileID: 4243303135242065321}
|
||||
- component: {fileID: 218743860388316554}
|
||||
- component: {fileID: 8751394785182685024}
|
||||
m_Layer: 5
|
||||
m_Name: Status
|
||||
m_TagString: Untagged
|
||||
@ -2225,6 +2226,18 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!225 &8751394785182685024
|
||||
CanvasGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6963744598854301550}
|
||||
m_Enabled: 1
|
||||
m_Alpha: 1
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!1 &7468074698396101124
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -113,7 +113,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 35, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 14}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4283453029241301366
|
||||
@ -171,6 +171,69 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!1 &1594929395943128068
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3133714956822662103}
|
||||
- component: {fileID: 7495680204347569398}
|
||||
- component: {fileID: 6387954282718075555}
|
||||
m_Layer: 5
|
||||
m_Name: textController
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &3133714956822662103
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1594929395943128068}
|
||||
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: 6024573468857070111}
|
||||
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: 28, y: 11}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &7495680204347569398
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1594929395943128068}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 55b5a59897c650342a9b23ff348a9992, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &6387954282718075555
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1594929395943128068}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f8c8bf670921e114bbea10f451c86392, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Camera: {fileID: 0}
|
||||
PlaneDistance: 20
|
||||
--- !u!1 &1875779720381973549
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -304,6 +367,55 @@ CanvasGroup:
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!1 &2518379931765104815
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6024573468857070111}
|
||||
- component: {fileID: 4942439251290342389}
|
||||
m_Layer: 0
|
||||
m_Name: New Game Object
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &6024573468857070111
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2518379931765104815}
|
||||
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: 3133714956822662103}
|
||||
m_Father: {fileID: 3781681077856850776}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 10, y: -11}
|
||||
m_SizeDelta: {x: 0, y: 22}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &4942439251290342389
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2518379931765104815}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 55b5a59897c650342a9b23ff348a9992, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &3582975722771982388
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1865,7 +1977,7 @@ GameObject:
|
||||
- component: {fileID: 1745325752441454819}
|
||||
- component: {fileID: 6307907517525328669}
|
||||
- component: {fileID: 4025239828189630988}
|
||||
- component: {fileID: 3178332653893988551}
|
||||
- component: {fileID: 1989110628175331005}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
@ -1889,7 +2001,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 29, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 22}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6307907517525328669
|
||||
@ -1932,8 +2044,8 @@ MonoBehaviour:
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Booked
|
||||
--- !u!114 &3178332653893988551
|
||||
m_Text: Booker
|
||||
--- !u!114 &1989110628175331005
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@ -2125,6 +2237,9 @@ GameObject:
|
||||
- component: {fileID: 7321607841691860978}
|
||||
- component: {fileID: 4243303135242065321}
|
||||
- component: {fileID: 218743860388316554}
|
||||
- component: {fileID: 6879336690456023343}
|
||||
- component: {fileID: 222947245583201638}
|
||||
- component: {fileID: 1028197714189782262}
|
||||
m_Layer: 5
|
||||
m_Name: Status
|
||||
m_TagString: Untagged
|
||||
@ -2144,6 +2259,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1745325752441454819}
|
||||
- {fileID: 6024573468857070111}
|
||||
m_Father: {fileID: 5521075338391914460}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -2179,7 +2295,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Texture: {fileID: 2800000, guid: 4214119458c589c409b03681f25e73d8, type: 3}
|
||||
m_Texture: {fileID: 0}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
@ -2223,8 +2339,46 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_HorizontalFit: 1
|
||||
m_VerticalFit: 0
|
||||
--- !u!114 &6879336690456023343
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6963744598854301550}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 109c41f08973846429af681aea0a30c4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
r: {x: 0, y: 10, z: 0, w: 10}
|
||||
rect2props: {x: 0.0000004172325, y: -0.0000014901161, z: 7.7781754, w: 0.7071068}
|
||||
--- !u!225 &222947245583201638
|
||||
CanvasGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6963744598854301550}
|
||||
m_Enabled: 1
|
||||
m_Alpha: 1
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!114 &1028197714189782262
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6963744598854301550}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d832f1dc5650bd24b90dbd3efdc2780e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &7468074698396101124
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -193,22 +193,27 @@ public class RaceItemScript : MonoBehaviour
|
||||
var status = transform.Find("Status");
|
||||
if (mapCompetition.Status <= 1)
|
||||
{
|
||||
status.gameObject.SetActive(false);
|
||||
status.GetComponent<CanvasGroup>().alpha = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
status.GetComponent<RawImage>().color = Utils.HexToColorHtml(statusColorDict[mapCompetition.Status]);
|
||||
if (mapCompetition.Status == 2 && !mapCompetition.HasJoin)
|
||||
{
|
||||
status.gameObject.SetActive(false);
|
||||
status.GetComponent<CanvasGroup>().alpha = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
status.gameObject.SetActive(true);
|
||||
status.GetComponent<CanvasGroup>().alpha = 1;
|
||||
status.Find("Text").GetComponent<Text>().text =
|
||||
mapCompetition.Status == 2?"Registered":mapCompetition.StatusVlaue;
|
||||
}
|
||||
}
|
||||
if (status.GetComponent<ContentFitterController>())
|
||||
{
|
||||
Debug.Log("cf刷新一次1");
|
||||
status.GetComponent<ContentFitterController>().Refresh();
|
||||
}
|
||||
}
|
||||
float? localY = null;
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
|
||||
@ -214,6 +214,7 @@ public class UIManager : MonoBehaviour
|
||||
public static void ShowRaceDetailModal(Transform parent,MapCompetition mapCompetition)
|
||||
{
|
||||
UIManager.Show(UIManager.Instance.RaceDetailModal, null, true);
|
||||
UIManager.Instance.RaceDetailModal.transform.SetAsFirstSibling();
|
||||
UIManager.Instance.mRaceModalScript.Initial(parent, mapCompetition);
|
||||
//UIManager.Show(UIManager.Instance.RaceListPanel, UIManager.Instance.MainPanel);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user