public override void Setup() { base.Setup(); m_Stack = ScriptableObject.CreateInstance <FilterStack>(); m_Context = new FilterContext(FilterUtility.defaultFormat, Vector3.zero, 1f, 0f); }
static void CreateAsset() { FilterStack fs = ScriptableObject.CreateInstance <FilterStack>(); AssetDatabase.CreateAsset(fs, "Assets/New Filter Stack.asset"); AssetDatabase.SaveAssets(); EditorGUIUtility.PingObject(fs); Selection.activeObject = fs; }
public FilterStackView(GUIContent label, SerializedObject serializedFilterStackObject) { m_label = label; m_serializedObject = serializedFilterStackObject; m_filterStack = serializedFilterStackObject.targetObject as FilterStack; m_filtersProperty = serializedFilterStackObject.FindProperty("filters"); m_reorderableList = new ReorderableList(serializedFilterStackObject, m_filtersProperty, true, true, true, true); Init(); SetupCallbacks(); }
private void SaveFilterStack(FilterStack filterStack) { List <UnityEngine.Object> objList = new List <UnityEngine.Object>(); objList.Add(filterStack); objList.AddRange(filterStack.filters); filterStack.filters.ForEach((f) => { var l = f.GetObjectsToSerialize(); if (l != null && l.Count > 0) { objList.AddRange(l); } }); // write to the file UnityEditorInternal.InternalEditorUtility.SaveToSerializedFileAndForget(objList.ToArray(), getFilterStackFilePath, true); }