修补一些bug
This commit is contained in:
@@ -26,16 +26,31 @@ namespace Convention.WindowsUI.Variant
|
||||
|
||||
public void CameraSelect(bool isScene)
|
||||
{
|
||||
IsSelectSceneCamera = isScene;
|
||||
SceneCamera.gameObject.SetActive(isScene);
|
||||
ModuleCamera.gameObject.SetActive(!isScene);
|
||||
if (m_GameObjectOnSceneOnly != null)
|
||||
if (ModuleCamera == null)
|
||||
{
|
||||
m_GameObjectOnSceneOnly.SetActive(isScene);
|
||||
IsSelectSceneCamera = true;
|
||||
SceneCamera.gameObject.SetActive(true);
|
||||
m_GameObjectOnSceneOnly.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
IsSelectSceneCamera = isScene;
|
||||
SceneCamera.gameObject.SetActive(isScene);
|
||||
ModuleCamera.gameObject.SetActive(!isScene);
|
||||
if (m_GameObjectOnSceneOnly != null)
|
||||
{
|
||||
m_GameObjectOnSceneOnly.SetActive(isScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if(IsSelectSceneCamera==false&& ModuleCamera==null)
|
||||
{
|
||||
CameraSelect(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@@ -43,7 +58,7 @@ namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
m_WindowManager = GetComponent<WindowManager>();
|
||||
}
|
||||
if(MainCamera==null)
|
||||
if (MainCamera == null)
|
||||
{
|
||||
MainCamera = Camera.main.GetComponent<CinemachineBrain>();
|
||||
}
|
||||
|
@@ -288,50 +288,12 @@ namespace Convention.WindowsUI.Variant
|
||||
|
||||
private void ForceRebuildLayoutImmediate()
|
||||
{
|
||||
// TODO
|
||||
{
|
||||
RectTransformExtension.AdjustSizeToContainsChilds(ref_value.transform as RectTransform);
|
||||
}
|
||||
return;
|
||||
/*
|
||||
if (ref_value != null)
|
||||
{
|
||||
ConventionUtility.StartCoroutine(Adjuster(ref_value.transform as RectTransform));
|
||||
|
||||
RectTransformExtension.AdjustSizeToContainsChilds(ref_value.transform as RectTransform);
|
||||
if (parentEntry != null)
|
||||
parentEntry.ForceRebuildLayoutImmediate();
|
||||
}
|
||||
if (parentWindow)
|
||||
{
|
||||
ConventionUtility.StartCoroutine(Adjuster(parentWindow.TargetWindowContent));
|
||||
}
|
||||
else
|
||||
{
|
||||
ConventionUtility.StartCoroutine(Adjuster2(parentEntry.ref_value.transform as RectTransform, parentEntry));
|
||||
}
|
||||
|
||||
static IEnumerator Adjuster(RectTransform rectTransform)
|
||||
{
|
||||
if (rectTransform == null)
|
||||
yield break;
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
|
||||
yield return null;
|
||||
if (rectTransform == null)
|
||||
yield break;
|
||||
RectTransformExtension.AdjustSizeToContainsChilds(rectTransform);
|
||||
}
|
||||
static IEnumerator Adjuster2(RectTransform rectTransform, ItemEntry parentEntry)
|
||||
{
|
||||
if (rectTransform == null)
|
||||
yield break;
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
|
||||
yield return null;
|
||||
if (rectTransform == null)
|
||||
yield break;
|
||||
RectTransformExtension.AdjustSizeToContainsChilds(rectTransform);
|
||||
yield return null;
|
||||
parentEntry.ForceRebuildLayoutImmediate();
|
||||
yield break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public void DisableChilds(bool isForceRebuildLayoutImmediate)
|
||||
|
@@ -84,8 +84,8 @@ namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
target.CreateItem(() =>
|
||||
{
|
||||
action.callback(rightTop);
|
||||
ReleaseAllCustomMenu();
|
||||
action.callback(rightTop);
|
||||
}, action.name);
|
||||
}
|
||||
CustomMenuRelease.gameObject.SetActive(true);
|
||||
|
Reference in New Issue
Block a user