Ejemplo n.º 1
0
        protected override void Rebuild()
        {
            base.Rebuild();
            var recipeBase = target as UMARecipeBase;

            if (PowerToolsIntegration.HasPowerTools() && PowerToolsIntegration.HasPreview(recipeBase))
            {
                _needsUpdate = true;
            }
        }
Ejemplo n.º 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);
            //}
        }
Ejemplo n.º 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);
            //}
        }
Ejemplo n.º 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();
     }
 }