-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
Replace MToon submodule with copying
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/[Ll]ibrary/ | ||
/[Tt]emp/ | ||
/[Oo]bj/ | ||
/[Bb]uild/ | ||
/[Bb]uilds/ | ||
/Assets/AssetStoreTools* | ||
|
||
# Visual Studio 2015 cache directory | ||
/.vs/ | ||
|
||
# Autogenerated VS/MD/Consulo solution and project files | ||
ExportedObj/ | ||
.consulo/ | ||
*.csproj | ||
*.unityproj | ||
*.sln | ||
*.suo | ||
*.tmp | ||
*.user | ||
*.userprefs | ||
*.pidb | ||
*.booproj | ||
*.svd | ||
*.pdb | ||
|
||
# Unity3D generated meta files | ||
*.pidb.meta | ||
|
||
# Unity3D Generated File On Crash Reports | ||
sysinfo.txt | ||
|
||
# Builds | ||
*.apk | ||
*.unitypackage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Masataka SUMI | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace MToon | ||
{ | ||
public enum EditorRotationUnit | ||
{ | ||
Rounds = 0, | ||
Degrees = 1, | ||
Radians = 2, | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System.IO; | ||
using System.Text.RegularExpressions; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace MToon | ||
{ | ||
public static class EditorUtils | ||
{ | ||
private static string BasePath { get { return Path.Combine(Application.dataPath, "VRM/MToon"); } } | ||
|
||
private static string ShaderFilePath { get { return Path.Combine(BasePath, "MToon/Resources/Shaders/MToon.shader"); } } | ||
private static string ReadMeFilePath { get { return Path.Combine(BasePath, "README.md"); } } | ||
private static string VersionFilePath { get { return Path.Combine(BasePath, "MToon/Scripts/UtilsVersion.cs"); } } | ||
|
||
|
||
//[MenuItem("VRM/MToon Version Up")] | ||
private static void VerUp(string version) | ||
{ | ||
UpdateShaderFile(version); | ||
UpdateReadMeFile(version); | ||
UpdateVersionFile(version); | ||
} | ||
|
||
private static void UpdateShaderFile(string version) | ||
{ | ||
var file = File.ReadAllText(ShaderFilePath); | ||
file = Regex.Replace( | ||
file, | ||
"(_MToonVersion \\(\"_MToonVersion\", Float\\) = )(\\d+)", | ||
"${1}" + version | ||
); | ||
File.WriteAllText(ShaderFilePath, file); | ||
} | ||
|
||
private static void UpdateReadMeFile(string version) | ||
{ | ||
version = "v" + version.Substring(0, version.Length - 1) + "." + version[version.Length - 1]; | ||
|
||
var file = File.ReadAllText(ReadMeFilePath); | ||
file = Regex.Replace( | ||
file, | ||
"v(\\d+)\\.(\\d+)", | ||
version | ||
); | ||
File.WriteAllText(ReadMeFilePath, file); | ||
} | ||
|
||
private static void UpdateVersionFile(string version) | ||
{ | ||
var file = File.ReadAllText(VersionFilePath); | ||
file = Regex.Replace( | ||
file, | ||
"(public const int VersionNumber = )(\\d+)(;)", | ||
"${1}" + version + "${3}" | ||
); | ||
File.WriteAllText(VersionFilePath, file); | ||
|
||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "MToon.Editor", | ||
"references": [ | ||
"GUID:a9bc101fb0471f94a8f99fd242fdd934" | ||
], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": false, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.