Exemplo n.º 1
0
        protected override void SingletonInit()
        {
            m_LastKnownResolution    = new PropertyPrefVector2Int("DQR.EZInspect.LastKnownRes", Vector2Int.zero);
            m_FontScale              = new PropertyPrefFloat("DQR.EZInspect.FontScale", 1.0f);
            m_ResetOnResolutionScale = new PropertyPrefBool("DQR.EZInspect.ResetOnResolution", true);
            m_ApplyResolutionScale   = new PropertyPrefBool("DQR.EZInspect.ApplyResolutionScale", true);

            SetupListenerContainerIfRequired(gameObject);
            ImGuiUn.Layout += OnImGuiLayout;

#if UNITY_EDITOR
            EditorApplication.hierarchyChanged += OnEditorHierarchyChanged;
#endif
        }
        public EZInspectionListenerContainer(GameObject context, IEZInspectionListener listener)
        {
            m_Listener = listener;
            m_Props    = m_Listener.GetInspectProperties();

            if (string.IsNullOrWhiteSpace(m_Props.TitleOverride))
            {
                m_ShortTitle = listener.GetType().Name;
            }
            else
            {
                m_ShortTitle = m_Props.TitleOverride;
            }

            m_FullTitle         = context.name + "." + m_ShortTitle;
            m_IsInspectorActive = new PropertyPrefBool("DQR.EZInspect." + m_FullTitle + ".Active", m_Props.IsHiddenByDefault);
        }