示例#1
0
        protected override void Rebuild()
        {
            base.Rebuild();
            var recipeBase = target as UMARecipeBase;

            if (PowerToolsIntegration.HasPowerTools() && PowerToolsIntegration.HasPreview(recipeBase))
            {
                _needsUpdate = true;
            }
        }
示例#2
0
        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);
            //}
        }
示例#3
0
        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);
            //}
        }
示例#4
0
 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();
     }
 }