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; }
public override void OnInspectorGUI() { swapObject = target as PaletteSwapObject; if (texBuilder == null) { texBuilder = new TextureBuilder(); } GUIPaletteSwapper(); if (previewFocus) { spritePreview.Focus(); previewFocus = false; } }