ui基本完毕,修了一大把的bug
This commit is contained in:
@@ -125,6 +125,11 @@ public class URadarChartController : MonoBehaviour
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (rebuildQueued)
|
||||
{
|
||||
TryRebuild();
|
||||
@@ -224,14 +229,15 @@ public class URadarChartController : MonoBehaviour
|
||||
{
|
||||
DisableLegacyRenderer();
|
||||
|
||||
EnsureChartHost();
|
||||
bool allowRuntimeChartMutation = Application.isPlaying;
|
||||
EnsureChartHost(allowRuntimeChartMutation);
|
||||
|
||||
if (radarChart == null)
|
||||
{
|
||||
radarChart = radarChartHost != null ? radarChartHost.GetComponent<RadarChart>() : null;
|
||||
}
|
||||
|
||||
if (radarChart == null && radarChartHost != null)
|
||||
if (allowRuntimeChartMutation && radarChart == null && radarChartHost != null)
|
||||
{
|
||||
radarChart = radarChartHost.gameObject.AddComponent<RadarChart>();
|
||||
}
|
||||
@@ -242,7 +248,7 @@ public class URadarChartController : MonoBehaviour
|
||||
radarChart.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (initializeChart)
|
||||
if (allowRuntimeChartMutation && initializeChart)
|
||||
{
|
||||
EnsureChartInitialized();
|
||||
}
|
||||
@@ -264,6 +270,12 @@ public class URadarChartController : MonoBehaviour
|
||||
|
||||
private void TryRebuild()
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
rebuildQueued = false;
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureRenderer();
|
||||
if (radarChart == null)
|
||||
{
|
||||
@@ -538,7 +550,7 @@ public class URadarChartController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureChartHost()
|
||||
private void EnsureChartHost(bool createIfMissing)
|
||||
{
|
||||
if (radarChartHost == null)
|
||||
{
|
||||
@@ -549,13 +561,18 @@ public class URadarChartController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (radarChartHost == null)
|
||||
if (radarChartHost == null && createIfMissing)
|
||||
{
|
||||
GameObject host = new GameObject(radarChartHostName, typeof(RectTransform));
|
||||
radarChartHost = host.GetComponent<RectTransform>();
|
||||
radarChartHost.SetParent(transform, false);
|
||||
}
|
||||
|
||||
if (radarChartHost == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
radarChartHost.anchorMin = Vector2.zero;
|
||||
radarChartHost.anchorMax = Vector2.one;
|
||||
radarChartHost.pivot = new Vector2(0.5f, 0.5f);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class uBehaviourRaderController : MonoBehaviour
|
||||
private void OnEnable()
|
||||
{
|
||||
BindOverlayVisibility();
|
||||
ApplyOverlayVisibility(btmandtopController.CurrentOverlayPanelsVisible);
|
||||
ApplyOverlayVisibility(hideWhenOverlayVisible && btmandtopController.CurrentOverlayPanelsVisible);
|
||||
if (reloadOnEnable && Application.isPlaying)
|
||||
{
|
||||
BeginLoad();
|
||||
@@ -168,6 +168,13 @@ public class uBehaviourRaderController : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// Guard against misconfiguration where uRaderObj fell back to the controller host.
|
||||
// In that case host.GetChild loop would deactivate the radar host child itself.
|
||||
if (uRaderObj == gameObject)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Transform host = transform;
|
||||
Transform target = uRaderObj.transform;
|
||||
for (int i = 0; i < host.childCount; i++)
|
||||
@@ -218,7 +225,7 @@ public class uBehaviourRaderController : MonoBehaviour
|
||||
|
||||
private void HandleOverlayPanelsVisibilityChanged(bool visible)
|
||||
{
|
||||
ApplyOverlayVisibility(visible);
|
||||
ApplyOverlayVisibility(hideWhenOverlayVisible && visible);
|
||||
}
|
||||
|
||||
private void ApplyOverlayVisibility(bool overlayVisible)
|
||||
|
||||
Reference in New Issue
Block a user