com.soviby.unity.ui.ugui-to.../Assets/Editor/Helper/EntityHelper.cs

31 lines
863 B
C#
Raw Permalink Normal View History

2024-10-28 16:31:38 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public static class EntityHelper
{
public static void UpdateHierarchyOfEntity(in bool show, in GameObject entity)
{
entity.hideFlags = show ? HideFlags.DontSave : HideFlags.HideAndDontSave;
}
public static void UpdateSceneVisibilityOfEntity(in bool show, in GameObject entity)
{
if (show)
{
SceneVisibilityManager.instance.EnablePicking(entity, true);
}
else {
SceneVisibilityManager.instance.DisablePicking(entity, true);
}
}
2024-10-29 17:51:06 +00:00
public static void UpdateHierarchyAndSceneVisibilityOfEntity(in bool show, in GameObject entity)
{
UpdateHierarchyOfEntity(show, entity.gameObject);
UpdateSceneVisibilityOfEntity(show, entity.gameObject);
}
2024-10-28 16:31:38 +00:00
}