示例#1
0
        public override void Setup()
        {
            base.Setup();

            m_Stack   = ScriptableObject.CreateInstance <FilterStack>();
            m_Context = new FilterContext(FilterUtility.defaultFormat, Vector3.zero, 1f, 0f);
        }
示例#2
0
        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();
        }
示例#4
0
        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);
        }