35 lines
889 B
C#
35 lines
889 B
C#
|
|
#if UNITY_EDITOR
|
|
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);
|
|
}
|
|
}
|
|
|
|
public static void UpdateHierarchyAndSceneVisibilityOfEntity(in bool show, in GameObject entity)
|
|
{
|
|
UpdateHierarchyOfEntity(show, entity.gameObject);
|
|
UpdateSceneVisibilityOfEntity(show, entity.gameObject);
|
|
}
|
|
}
|
|
|
|
#endif
|