first commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Plugin(BoltState.ID)]
|
||||
internal class Migration_1_5_1_to_1_5_2 : PluginMigration
|
||||
{
|
||||
internal Migration_1_5_1_to_1_5_2(Plugin plugin) : base(plugin)
|
||||
{
|
||||
order = 1;
|
||||
}
|
||||
|
||||
public override SemanticVersion @from => "1.5.1";
|
||||
public override SemanticVersion to => "1.5.2";
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
try
|
||||
{
|
||||
MigrateProjectSettings();
|
||||
}
|
||||
#pragma warning disable 168
|
||||
catch (Exception e)
|
||||
#pragma warning restore 168
|
||||
{
|
||||
Debug.LogWarning("There was a problem migrating your Visual Scripting project settings. Be sure to check them in Edit -> Project Settings -> Visual Scripting");
|
||||
#if VISUAL_SCRIPT_DEBUG_MIGRATION
|
||||
Debug.LogError(e);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private static void MigrateProjectSettings()
|
||||
{
|
||||
BoltState.Configuration.LoadOrCreateProjectSettingsAsset();
|
||||
|
||||
var legacyProjectSettingsAsset = MigrationUtility_1_5_1_to_1_5_2.GetLegacyProjectSettingsAsset("VisualScripting.State");
|
||||
if (legacyProjectSettingsAsset != null)
|
||||
{
|
||||
BoltState.Configuration.projectSettingsAsset.Merge(legacyProjectSettingsAsset);
|
||||
}
|
||||
|
||||
BoltState.Configuration.SaveProjectSettingsAsset(true);
|
||||
BoltState.Configuration.ResetProjectSettingsMetadata();
|
||||
}
|
||||
}
|
||||
|
||||
[Plugin(BoltState.ID)]
|
||||
internal class DeprecatedSavedVersionLoader_1_5_1 : PluginDeprecatedSavedVersionLoader
|
||||
{
|
||||
internal DeprecatedSavedVersionLoader_1_5_1(Plugin plugin) : base(plugin) { }
|
||||
|
||||
public override SemanticVersion @from => "1.5.1";
|
||||
|
||||
public override bool Run(out SemanticVersion savedVersion)
|
||||
{
|
||||
var manuallyParsedVersion = MigrationUtility_1_5_1_to_1_5_2.TryManualParseSavedVersion("VisualScripting.State");
|
||||
savedVersion = manuallyParsedVersion;
|
||||
|
||||
return savedVersion != "0.0.0";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6753fa3367ac4986a92909ed6eb78772
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Plugin(BoltState.ID)]
|
||||
internal class Migration_1_6_to_1_7 : PluginMigration
|
||||
{
|
||||
internal Migration_1_6_to_1_7(Plugin plugin) : base(plugin)
|
||||
{
|
||||
order = 2;
|
||||
}
|
||||
|
||||
public override SemanticVersion @from => "1.6.1000";
|
||||
public override SemanticVersion to => "1.7.0-pre.0";
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
// Need to reset our project settings metadata list to point to the new project settings asset and
|
||||
// underlying dictionary. That way when it gets saved we don't overwrite the files data
|
||||
BoltState.Configuration.LoadProjectSettings();
|
||||
}
|
||||
}
|
||||
|
||||
[Plugin(BoltState.ID)]
|
||||
internal class DeprecatedSavedVersionLoader_1_6_1 : PluginDeprecatedSavedVersionLoader
|
||||
{
|
||||
public DeprecatedSavedVersionLoader_1_6_1(Plugin plugin) : base(plugin) { }
|
||||
|
||||
public override SemanticVersion @from => "1.6.1";
|
||||
|
||||
public override bool Run(out SemanticVersion savedVersion)
|
||||
{
|
||||
savedVersion = new SemanticVersion();
|
||||
try
|
||||
{
|
||||
var legacyProjectSettingsAsset = MigrationUtility_1_6_to_1_7.GetLegacyProjectSettingsAsset("VisualScripting.State");
|
||||
if (legacyProjectSettingsAsset == null)
|
||||
return false;
|
||||
|
||||
savedVersion = (SemanticVersion)legacyProjectSettingsAsset["savedVersion"];
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55f9606c92224790823f7ac7fd2c8d41
|
||||
timeCreated: 1618943136
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Plugin(BoltState.ID)]
|
||||
internal class Migration_Asset_to_Package : PluginMigration
|
||||
{
|
||||
public Migration_Asset_to_Package(Plugin plugin) : base(plugin)
|
||||
{
|
||||
order = 2;
|
||||
}
|
||||
|
||||
public override SemanticVersion @from => "1.4.1000";
|
||||
public override SemanticVersion to => "1.5.0-pre.0";
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
plugin.configuration.Initialize();
|
||||
|
||||
try
|
||||
{
|
||||
MigrateProjectSettings();
|
||||
}
|
||||
#pragma warning disable 168
|
||||
catch (Exception e)
|
||||
#pragma warning restore 168
|
||||
{
|
||||
Debug.LogWarning("There was a problem migrating your Visual Scripting project settings. Be sure to check them in Edit -> Project Settings -> Visual Scripting");
|
||||
#if VISUAL_SCRIPT_DEBUG_MIGRATION
|
||||
Debug.LogError(e);
|
||||
#endif
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
MigrationUtility_Asset_to_Package.MigrateEditorPreferences(this.plugin);
|
||||
}
|
||||
#pragma warning disable 168
|
||||
catch (Exception e)
|
||||
#pragma warning restore 168
|
||||
{
|
||||
Debug.LogWarning("There was a problem migrating your Visual Scripting editor preferences. Be sure to check them in Edit -> Preferences -> Visual Scripting");
|
||||
#if VISUAL_SCRIPT_DEBUG_MIGRATION
|
||||
Debug.LogError(e);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private static void MigrateProjectSettings()
|
||||
{
|
||||
// Bolt.State -> VisualScripting.State
|
||||
BoltState.Configuration.LoadOrCreateProjectSettingsAsset();
|
||||
|
||||
var legacyProjectSettingsAsset = MigrationUtility_Asset_to_Package.GetLegacyProjectSettingsAsset("Bolt.State");
|
||||
if (legacyProjectSettingsAsset != null)
|
||||
{
|
||||
BoltState.Configuration.projectSettingsAsset.Merge(legacyProjectSettingsAsset);
|
||||
}
|
||||
|
||||
BoltState.Configuration.SaveProjectSettingsAsset(true);
|
||||
BoltState.Configuration.ResetProjectSettingsMetadata();
|
||||
}
|
||||
}
|
||||
|
||||
[Plugin(BoltState.ID)]
|
||||
internal class DeprecatedSavedVersionLoader_Bolt_AssetStore : PluginDeprecatedSavedVersionLoader
|
||||
{
|
||||
public DeprecatedSavedVersionLoader_Bolt_AssetStore(Plugin plugin) : base(plugin) { }
|
||||
|
||||
public override SemanticVersion @from => "1.4.13";
|
||||
|
||||
public override bool Run(out SemanticVersion savedVersion)
|
||||
{
|
||||
var manuallyParsedVersion = MigrationUtility_Asset_to_Package.TryManualParseSavedVersion("Bolt.State");
|
||||
savedVersion = manuallyParsedVersion;
|
||||
|
||||
return savedVersion != "0.0.0";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80b5f06f2b254106834105b126a44f19
|
||||
timeCreated: 1605804325
|
||||
Reference in New Issue
Block a user