// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value.
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEngine;
namespace Animancer.Editor
{
/// [Editor-Only] A welcome screen for .
/// https://kybernetik.com.au/animancer/api/Animancer.Editor/AnimancerReadMe
///
// [CreateAssetMenu]
[AnimancerHelpUrl(typeof(AnimancerReadMe))]
public class AnimancerReadMe : ReadMe
{
/************************************************************************************************************************/
/// The release ID of the current version.
///
/// - [ 1] = v1.0.0: 2018-05-02.
/// - [ 2] = v1.1.0: 2018-05-29.
/// - [ 3] = v1.2.0: 2018-08-14.
/// - [ 4] = v1.3.0: 2018-09-12.
/// - [ 5] = v2.0.0: 2018-10-08.
/// - [ 6] = v3.0.0: 2019-05-27.
/// - [ 7] = v3.1.0: 2019-08-12.
/// - [ 8] = v4.0.0: 2020-01-28.
/// - [ 9] = v4.1.0: 2020-02-21.
/// - [10] = v4.2.0: 2020-03-02.
/// - [11] = v4.3.0: 2020-03-13.
/// - [12] = v4.4.0: 2020-03-27.
/// - [13] = v5.0.0: 2020-07-17.
/// - [14] = v5.1.0: 2020-07-27.
/// - [15] = v5.2.0: 2020-09-16.
/// - [16] = v5.3.0: 2020-10-06.
/// - [17] = v6.0.0: 2020-12-04.
/// - [18] = v6.1.0: 2021-04-13.
/// - [19] = v7.0.0: 2021-07-29.
/// - [20] = v7.1.0: 2021-08-13.
/// - [21] = v7.2.0: 2021-10-17.
/// - [22] = v7.3.0: 2022-07-03.
/// - [23] = v7.4.0: 2023-01-26.
/// - [24] = v7.4.1: 2023-01-28.
/// - [25] = v7.4.2: 2023-01-31.
/// - [26] = v7.4.3: 2023-04-16.
/// - [27] = v8.0.0: 2024-08-17.
/// - [28] = v8.0.1: 2024-09-08.
/// - [29] = v8.0.2: 2024-11-02.
///
public override int ReleaseNumber => 29;
///
public override string VersionName => Strings.DocsURLs.VersionName;
///
public override string PrefKey => nameof(Animancer);
///
public override string BaseProductName => Strings.ProductName;
///
public override string ProductName => Strings.ProductName + " Pro";
///
public override string DocumentationURL => Strings.DocsURLs.Documentation;
///
public override string ChangeLogURL => Strings.DocsURLs.ChangeLogURL;
///
public override string SamplesURL => Strings.DocsURLs.Samples;
///
public override string UpdateURL => Strings.DocsURLs.LatestVersion;
/************************************************************************************************************************/
public AnimancerReadMe() : base(
new("Issues",
"for questions, suggestions, and bug reports",
Strings.DocsURLs.Issues),
new("Discussions",
"for general discussions, feedback, and news",
Strings.DocsURLs.Discussions),
new("Email",
"for anything private",
GetEmailURL(Strings.DocsURLs.DeveloperEmail, Strings.ProductName),
Strings.DocsURLs.DeveloperEmail))
{
ExtraSamples = new LinkSection[]
{
new("Platformer Game Kit", null, "https://kybernetik.com.au/platformer"),
};
}
/************************************************************************************************************************/
/// [Editor-Only] A custom Inspector for .
[CustomEditor(typeof(AnimancerReadMe), editorForChildClasses: true)]
public new class Editor : ReadMe.Editor
{
/************************************************************************************************************************/
/// A callback to execute data migration.
public static event Action MigrateOldAssetData;
/************************************************************************************************************************/
///
protected override void DoNewVersionDetails()
{
base.DoNewVersionDetails();
if (MigrateOldAssetData == null)
return;
var text = $"Migrate old asset data to {Target.BaseProductName} {Target.VersionName}";
if (GUILayout.Button(text))
MigrateOldAssetData(text);
}
/************************************************************************************************************************/
}
}
}
#endif