Beispiel #1
0
 public override void OnInspectorGUI()
 {
     this.manager = (WindowManager)base.target;
     if (this.windowList == null)
     {
         this.windowList = new plyReorderableList(this.manager.windows, typeof(GameObject), true, true, true, true, false, false, false, null, null);
         this.windowList.elementHeight       = (float)(EditorGUIUtility.singleLineHeight + 6.0);
         this.windowList.drawHeaderCallback  = this.DrawListHeader;
         this.windowList.drawElementCallback = this.DrawElement;
         this.windowList.onAddElement        = this.OnAdd;
         this.windowList.onRemoveElement     = this.OnRemove;
         this.windowList.onReorder           = this.OnReorder;
     }
     EditorGUILayout.Space();
     this.windowList.DoLayoutList();
     base.serializedObject.Update();
     EditorGUILayout.PropertyField(this.p_onWindowShown);
     EditorGUILayout.PropertyField(this.p_onWindowHidden);
     base.serializedObject.ApplyModifiedProperties();
     EditorGUILayout.Space();
     if (GUI.changed)
     {
         plyEdUtil.SetDirty(this.manager);
         GUI.changed = false;
     }
 }
 public override bool DrawAdvancedEditor(plyVar target, bool isOnSceneObject, Action saveCallback)
 {
     this.doCloseStandalone = false;
     this.isOnSceneObject   = isOnSceneObject;
     this.saveCallback      = saveCallback;
     this.targetVar         = target;
     this.targetHandler     = (plyVar_Array)target.ValueHandler;
     if (this.list == null)
     {
         this.list = new plyReorderableList(null, typeof(plyVar), false, true, true, true, true, false, new plyReorderableList.Button[1]
         {
             new plyReorderableList.Button
             {
                 label    = new GUIContent(Ico._arrow_up, "Back to variables list"),
                 callback = delegate
                 {
                     this.doCloseStandalone = true;
                 }
             }
         }, null);
         this.list.elementHeight       = (float)(EditorGUIUtility.singleLineHeight + 2.0);
         this.list.drawHeaderCallback  = this.DrawListHeader;
         this.list.drawElementCallback = this.DrawElement;
         this.list.onAddElement        = this.OnAdd;
         this.list.onRemoveElement     = this.OnRemove;
     }
     this.list.list = this.targetHandler.variables;
     this.list.DoLayoutList();
     return(this.doCloseStandalone);
 }
Beispiel #3
0
 public override void OnInspectorGUI()
 {
     this.Target = (SplashScreensManager)base.target;
     if (this.screenList == null)
     {
         this.screenList = new plyReorderableList(this.Target.screens, typeof(SplashScreensManager.SplashScreen), true, true, true, true, false, false, false, null, null);
         this.screenList.elementHeight       = (float)(3.0 * (EditorGUIUtility.singleLineHeight + 2.0) + 6.0);
         this.screenList.drawHeaderCallback  = this.DrawListHeader;
         this.screenList.drawElementCallback = this.DrawElement;
         this.screenList.onAddElement        = this.OnAdd;
         this.screenList.onRemoveElement     = this.OnRemove;
         this.screenList.onReorder           = this.OnReorder;
     }
     EditorGUILayout.Space();
     this.screenList.DoLayoutList();
     this.Target.autoUnloadWhenDone = (AutoUnloadOption)EditorGUILayout.EnumPopup(SplashScreensManagerInspector.GC_AutoUnload, (Enum)(object)this.Target.autoUnloadWhenDone);
     this.Target.minShowTime        = EditorGUILayout.FloatField(SplashScreensManagerInspector.GC_MinShow, this.Target.minShowTime);
     EditorGUILayout.Space();
     base.serializedObject.Update();
     EditorGUILayout.PropertyField(this.p_onSpashScreenShown);
     EditorGUILayout.PropertyField(this.p_onSpashScreenHidden);
     EditorGUILayout.PropertyField(this.p_onSpashScreensDone);
     base.serializedObject.ApplyModifiedProperties();
     EditorGUILayout.Space();
     if (GUI.changed)
     {
         plyEdUtil.SetDirty(this.Target);
         GUI.changed = false;
     }
 }
Beispiel #4
0
 protected void OnEnable()
 {
     BloxContainerInspector.Instance = this;
     this.Target = (BloxContainer)base.target;
     if ((UnityEngine.Object) this.Target.bloxGlobalPrefab != (UnityEngine.Object)BloxEd.BloxGlobalPrefab)
     {
         this.Target.bloxGlobalPrefab = BloxEd.BloxGlobalPrefab;
         this.Save();
     }
     this.CacheBloxList(null, null);
     plyReorderableList.Button[] extraButtons = new plyReorderableList.Button[3]
     {
         new plyReorderableList.Button
         {
             label    = new GUIContent(Ico._settings, "Open Blox settings"),
             callback = BloxSettingsWindow.Show_BloxSettingsWindow
         },
         new plyReorderableList.Button
         {
             label           = new GUIContent(Ico._blox + "Edit", "Edit selected Blox"),
             callback        = this.OnDoubleClick,
             requireSelected = true
         },
         new plyReorderableList.Button
         {
             label           = new GUIContent(Ico._rename, "Rename selected Blox"),
             callback        = this.OnRenameBlox,
             requireSelected = true
         }
     };
     plyReorderableList.Button[] addOptions = new plyReorderableList.Button[2]
     {
         new plyReorderableList.Button
         {
             label    = new GUIContent("Create new"),
             callback = this.AddNewBloxDef
         },
         new plyReorderableList.Button
         {
             label    = new GUIContent("Add Existing"),
             callback = this.AddExistingBloxDef
         }
     };
     this.list = new plyReorderableList(this.targetBloxCache, typeof(Blox), true, true, true, true, false, false, false, extraButtons, addOptions);
     this.list.elementHeight        = (float)(EditorGUIUtility.singleLineHeight + 2.0 + 4.0);
     this.list.drawHeaderCallback   = this.DrawListHeader;
     this.list.drawElementCallback  = this.DrawListElement;
     this.list.onSelectElement      = this.OnSelectBlox;
     this.list.onDoubleClickElement = this.OnDoubleClick;
     this.list.onRemoveElement      = this.OnRemove;
     this.list.onReorder            = this.OnReorder;
     this.varEditor         = new plyVariablesEditor(null, plyVariablesType.Blox, this.Target.gameObject, true, false, true, this.Repaint, this.Save, null);
     this.varEditor.GC_Head = BloxContainerInspector.GC_VarsHead;
     if (this.targetBloxCache.Count > 0)
     {
         this.list.index = 0;
         this.OnSelectBlox();
     }
 }
 public plyVariablesEditor(plyVariables variables, plyVariablesType varsType, GameObject variablesOwner, bool canEditValues, bool canEditVariables, bool displayHeader, Action repaint, Action save, plyReorderableList.Button[] extraButtons)
 {
     plyVariablesEditor.LoadVarEds();
     this.variables        = variables;
     this.varsType         = varsType;
     this.variablesOwner   = variablesOwner;
     this.isOnSceneObject  = (!((UnityEngine.Object)variablesOwner == (UnityEngine.Object)null) && plyEdUtil.IsSceneObject(variablesOwner));
     this.canEditValues    = canEditValues;
     this.canEditVariables = canEditVariables;
     this.repaint          = repaint;
     this.save             = save;
     if (extraButtons == null)
     {
         extraButtons = new plyReorderableList.Button[0];
     }
     if (canEditVariables)
     {
         ArrayUtility.Add(ref extraButtons, new plyReorderableList.Button
         {
             label           = new GUIContent(Ico._rename, "Rename selected Variable"),
             callback        = this.OnRenameButton,
             requireSelected = true
         });
     }
     if (canEditVariables)
     {
         this.varsList = new plyReorderableList((variables != null) ? variables.varDefs : null, typeof(plyVar), false, true, true, true, false, false, extraButtons, null);
         this.varsList.elementHeight       = (float)((float)((!canEditValues) ? 1 : 2) * (EditorGUIUtility.singleLineHeight + 2.0) + 4.0);
         this.varsList.drawHeaderCallback  = this.DrawListHeader;
         this.varsList.drawElementCallback = this.DrawElement;
         this.varsList.onAddElement        = this.OnAdd;
         this.varsList.onRemoveElement     = this.OnRemove;
         this.varsList.onReorder           = null;
     }
     else
     {
         this.varsList = new plyReorderableList((variables != null) ? variables.varDefs : null, typeof(plyVar), false, displayHeader, false, false, false, false, extraButtons, null);
         this.varsList.elementHeight = (float)((float)((!canEditValues) ? 1 : 2) * (EditorGUIUtility.singleLineHeight + 2.0) + 4.0);
         if (displayHeader)
         {
             this.varsList.drawHeaderCallback = this.DrawListHeader;
         }
         this.varsList.drawElementCallback = this.DrawElement;
         this.varsList.onAddElement        = null;
         this.varsList.onRemoveElement     = null;
         this.varsList.onReorder           = null;
     }
 }
Beispiel #6
0
 private void SelectedPropertiesManager()
 {
     if (this.propertiesList == null)
     {
         this.propertiesList = new plyReorderableList(PropertiesManagerEd.PropertiesManager.properties, typeof(ManagedProperty), false, true, true, true, false, false, false, new plyReorderableList.Button[1]
         {
             new plyReorderableList.Button
             {
                 label           = new GUIContent(Ico._rename, "Rename selected Property"),
                 callback        = this.PropertiesList_RenameSelected,
                 requireSelected = true
             }
         }, null);
         this.propertiesList.elementHeight       = (float)(EditorGUIUtility.singleLineHeight + 6.0);
         this.propertiesList.drawHeaderCallback  = this.DrawPropertiesListHead;
         this.propertiesList.drawElementCallback = this.DrawPropertiesListElement;
         this.propertiesList.onAddElement        = this.PropertiesList_Add;
         this.propertiesList.onRemoveElement     = this.PropertiesList_Remove;
     }
 }
Beispiel #7
0
 public override void OnInspectorGUI()
 {
     base.serializedObject.Update();
     this.manager = (SplashScreensManager)base.target;
     if (this.manager._edDeserialize)
     {
         for (int i = 0; i < this.manager.screens.Count; i++)
         {
             if ((UnityEngine.Object) this.manager.screens[i].watchVariable != (UnityEngine.Object)null && this.manager.screens[i].watchVariable._edDeserialize)
             {
                 this.manager.screens[i].watchVariable.Deserialize();
             }
         }
         this.manager._edDeserialize = false;
         base.Repaint();
     }
     if (this.screenList == null)
     {
         this.screenList = new plyReorderableList(this.manager.screens, typeof(SplashScreensManager.SplashScreen), true, true, true, true, false, false, null, null);
         this.screenList.elementHeight       = (float)(3.0 * (EditorGUIUtility.singleLineHeight + 2.0) + 6.0);
         this.screenList.drawHeaderCallback  = this.DrawListHeader;
         this.screenList.drawElementCallback = this.DrawElement;
         this.screenList.onAddElement        = this.OnAdd;
         this.screenList.onRemoveElement     = this.OnRemove;
         this.screenList.onReorder           = this.OnReorder;
     }
     EditorGUILayout.Space();
     this.screenList.DoLayoutList();
     if (GUI.changed)
     {
         EditorUtility.SetDirty(this.manager);
         GUI.changed = false;
     }
     if ((UnityEngine.Object) this.removeComponent != (UnityEngine.Object)null && Event.current.type == EventType.Repaint)
     {
         UnityEngine.Object.DestroyImmediate(this.removeComponent);
         this.removeComponent = null;
         GUIUtility.ExitGUI();
     }
 }