public override void OnInspectorGUI() { if (serializedObject == null || serializedObject.targetObject == null) { return; } PopulateProperty("m_AutomaticLoading", ref m_AutomaticLoading); PopulateProperty("m_AutomaticRunning", ref m_AutomaticRunning); PopulateProperty("m_Loaders", ref m_LoaderList); serializedObject.Update(); if (m_MustReloadData) { ReloadData(); } EditorGUILayout.PropertyField(m_AutomaticLoading, k_AutoLoadLabel); if (m_AutomaticLoading.boolValue) { EditorGUILayout.PropertyField(m_AutomaticRunning, k_AutoRunLabel); } if (m_LoadOrderUI == null) { m_LoadOrderUI = new LoaderOrderUI(m_AllLoaderInfos, m_LoaderList); } m_MustReloadData = m_LoadOrderUI.OnGUI(); serializedObject.ApplyModifiedProperties(); }
void OnEnable() { if (m_LoadOrderUI == null) { m_LoadOrderUI = new LoaderOrderUI(() => { ShouldReload = true; }); } AssetCallbacks.Callback += AssetProcessorCallback; ShouldReload = true; }
void ReloadData() { if (m_LoaderList == null || m_LoaderList.serializedObject == null) { return; } m_LoadOrderUI = null; m_AllLoaderInfos.Clear(); PopulateLoaderInfosFromCurrentAssignedLoaders(); PopulateLoaderInfosFromUnassignedLoaders(); m_MustReloadData = false; }
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(); }