Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            if (serializedObject == null || serializedObject.targetObject == null)
            {
                return;
            }

            PopulateProperty("m_RequiresSettingsUpdate", ref m_RequiresSettingsUpdate);
            PopulateProperty("m_Loaders", ref m_LoaderList);

            serializedObject.Update();
            m_LoaderList.serializedObject.ApplyModifiedProperties();

            if (m_MustReloadData)
            {
                ReloadData();
            }

            if (m_LoadOrderUI == null)
            {
                m_LoadOrderUI = new LoaderOrderUI(m_AllLoaderInfos, m_CuratedInfo, m_AssignedLoaderInfos, m_LoaderList, () =>
                {
                    m_RequiresSettingsUpdate.boolValue = true;
                    LoaderOrderUICallback();
                });
            }
            else
            {
                if (m_RequiresSettingsUpdate.boolValue == true || m_LoadOrderUI.CheckIfChanged(m_AssignedLoaderInfos) || EditorPrefs.HasKey("defferedLoadPackage"))
                {
                    ReloadData();

                    m_LoadOrderUI.Reset(m_AllLoaderInfos, m_CuratedInfo, m_AssignedLoaderInfos, m_LoaderList, null);
                }
            }

            m_MustReloadData = m_LoadOrderUI.OnGUI();

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 2
0
        /// <summary><see href="https://docs.unity3d.com/ScriptReference/Editor.OnInspectorGUI.html">Editor Documentation</see></summary>
        public override void OnInspectorGUI()
        {
            if (serializedObject == null || serializedObject.targetObject == null)
            {
                return;
            }

            PopulateProperty("m_RequiresSettingsUpdate", ref m_RequiresSettingsUpdate);
            PopulateProperty("m_Loaders", ref m_LoaderList);

            serializedObject.Update();

            if (ShouldReload || m_LoadOrderUI.CheckIfChanged(m_AssignedLoaderInfos))
            {
                ShouldReload = false;
                LoaderOrderUICallback();
                m_LoadOrderUI.Reset(m_AllLoaderInfos, m_CuratedInfo, m_AssignedLoaderInfos, m_LoaderList);
            }

            ShouldReload = m_LoadOrderUI.OnGUI();

            serializedObject.ApplyModifiedProperties();
        }