mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-15 23:20:10 -05:00
Co-authored-by: Akihiko Odaki <nekomanma@pixiv.co.jp> Co-authored-by: Emiliana <vtemiliana@gmail.com> Co-authored-by: junichi_hirose <junichi_hirose@dwango.co.jp> Co-authored-by: Masataka SUMI <santarh@gmail.com> Co-authored-by: ousttrue <oustrrue@gmail.com> Co-authored-by: ousttrue <ousttrue@gmail.com> Co-authored-by: TORISOUP <tori.birdstrike@gmail.com> Co-authored-by: Yuki Shimada <emadurandal@gmail.com> Co-authored-by: yutopp <yutopp@gmail.com>
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
#if UNIGLTF_DEVELOP
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using UnityEditor;
|
|
|
|
|
|
namespace UniGLTF
|
|
{
|
|
public static class UniGLTFVersionMenu
|
|
{
|
|
public const int MENU_PRIORITY = 99;
|
|
static string path = "Assets/UniGLTF/Core/Scripts/UniGLTFVersion.cs";
|
|
|
|
const string template = @"
|
|
namespace UniGLTF
|
|
{{
|
|
public static partial class UniGLTFVersion
|
|
{{
|
|
public const int MAJOR = {0};
|
|
public const int MINOR = {1};
|
|
|
|
public const string VERSION = ""{0}.{1}"";
|
|
}}
|
|
}}
|
|
";
|
|
|
|
[MenuItem(UniGLTFVersion.UNIGLTF_VERSION + "/Increment", priority = MENU_PRIORITY)]
|
|
public static void IncrementVersion()
|
|
{
|
|
var source = string.Format(template, UniGLTFVersion.MAJOR, UniGLTFVersion.MINOR + 1);
|
|
File.WriteAllText(path, source);
|
|
AssetDatabase.Refresh();
|
|
}
|
|
|
|
[MenuItem(UniGLTFVersion.UNIGLTF_VERSION + "/Decrement", priority = MENU_PRIORITY)]
|
|
public static void DecrementVersion()
|
|
{
|
|
var source = string.Format(template, UniGLTFVersion.MAJOR, UniGLTFVersion.MINOR - 1);
|
|
File.WriteAllText(path, source);
|
|
AssetDatabase.Refresh();
|
|
}
|
|
}
|
|
}
|
|
#endif
|