Exemple #1
0
        static void CreateNewPaletteSwapObject()
        {
            PaletteSwapObject temp = ScriptableObject.CreateInstance <PaletteSwapObject>();

            temp.Filename = "New Palette Swap Object";
            temp.ColorOps = new System.Collections.Generic.List <ColorOperation>();

            string AssetPath = AssetDatabase.GenerateUniqueAssetPath("Assets/" + temp.Filename + ".asset");

            AssetDatabase.CreateAsset(temp, AssetPath);

            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
            EditorUtility.FocusProjectWindow();
            Selection.activeObject = temp;
        }
Exemple #2
0
        public override void OnInspectorGUI()
        {
            swapObject = target as PaletteSwapObject;

            if (texBuilder == null)
            {
                texBuilder = new TextureBuilder();
            }

            GUIPaletteSwapper();


            if (previewFocus)
            {
                spritePreview.Focus();
                previewFocus = false;
            }
        }