UniVRM/UniGLTF/Core/Scripts/Editor/UniGLTFVersionMenu.cs
ousttrue 1d108052de Merge commit '2a19c831f8440eed1279b9930ef33115c61d7d82' as 'UniGLTF'
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>
2018-12-28 20:16:54 +09:00

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