protected override void Rebuild() { base.Rebuild(); var recipeBase = target as UMARecipeBase; if (PowerToolsIntegration.HasPowerTools() && PowerToolsIntegration.HasPreview(recipeBase)) { _needsUpdate = true; } }
protected override void DoUpdate() { var recipeBase = (UMARecipeBase)target; Undo.RecordObject(recipeBase, "Recipe Editor"); recipeBase.Save(_recipe, UMAContext.FindInstance()); AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(recipeBase)); _rebuildOnLayout = true; _needsUpdate = false; if (PowerToolsIntegration.HasPreview(recipeBase)) { PowerToolsIntegration.Refresh(recipeBase); } //else //{ // PowerToolsIntegration.Show(recipeBase); //} }
protected override void DoUpdate() { var recipeBase = (UMARecipeBase)target; recipeBase.Save(_recipe, UMAContextBase.Instance); EditorUtility.SetDirty(recipeBase); AssetDatabase.SaveAssets(); // AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(recipeBase)); _rebuildOnLayout = true; _needsUpdate = false; if (PowerToolsIntegration.HasPreview(recipeBase)) { PowerToolsIntegration.Refresh(recipeBase); } //else //{ // PowerToolsIntegration.Show(recipeBase); //} }
private void PowerToolsGUI() { if (PowerToolsIntegration.HasPowerTools()) { GUILayout.BeginHorizontal(); var recipeBase = target as UMARecipeBase; if (PowerToolsIntegration.HasPreview(recipeBase)) { if (GUILayout.Button("Hide")) { PowerToolsIntegration.Hide(recipeBase); } if (GUILayout.Button("Create Prefab")) { //PowerToolsIntegration.CreatePrefab(recipeBase); } if (GUILayout.Button("Hide All")) { PowerToolsIntegration.HideAll(); } } else { if (GUILayout.Button("Show")) { PowerToolsIntegration.Show(recipeBase); } if (GUILayout.Button("Create Prefab")) { //PowerToolsIntegration.CreatePrefab(recipeBase); } if (GUILayout.Button("Hide All")) { PowerToolsIntegration.HideAll(); } } GUILayout.EndHorizontal(); } }