mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
Add a self-importing stub
This commit is contained in:
parent
9376fddc6e
commit
91fb887dad
@ -10,7 +10,7 @@
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.xr.oculus.standalone": "2.38.4",
|
||||
"com.unity.xr.openvr.standalone": "2.0.5",
|
||||
"net.fushizen.modular-avatar.core": "0.0.1",
|
||||
"net.fushizen.modular-avatar": "0.0.1",
|
||||
"com.unity.modules.ai": "1.0.0",
|
||||
"com.unity.modules.androidjni": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
|
@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.PackageManager;
|
||||
using UnityEditor.PackageManager.Requests;
|
||||
using UnityEngine;
|
||||
|
||||
namespace net.fushizen.modular_avatar.core.editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public static class ModularAvatarBootstrap
|
||||
{
|
||||
private const string VERSION = "0.0.1";
|
||||
private const string GIT_HASH = "d13c857e3ccffed4fa5f0ce53d9ad09a4fdd9b6b";
|
||||
|
||||
private const string GIT_URL =
|
||||
"git+ssh://github-bdunderscore/bdunderscore/modular-avatar.git?path=Packages/net.fushizen.modular-avatar#" +
|
||||
GIT_HASH;
|
||||
|
||||
private const string PACKAGE_NAME = "net.fushizen.modular-avatar";
|
||||
|
||||
private const string JSON_PACKAGE = "jillejr.newtonsoft.json-for-unity";
|
||||
|
||||
private static AddRequest Request;
|
||||
|
||||
static ModularAvatarBootstrap()
|
||||
{
|
||||
SemanticVersioning.Version installedVersion = null;
|
||||
try
|
||||
{
|
||||
installedVersion = GetInstalledVersion();
|
||||
var targetVersion = SemanticVersioning.Version.Parse(VERSION);
|
||||
|
||||
if (targetVersion <= installedVersion)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Assume we aren't installed.
|
||||
}
|
||||
|
||||
// VRCSDK depends on Newtonsoft JSON, so we can (theoretically) rely on it here.
|
||||
var manifestFile = Path.Combine(Application.dataPath, "../Packages/manifest.json");
|
||||
var manifestContents = File.ReadAllText(manifestFile, Encoding.UTF8);
|
||||
|
||||
JObject manifest = JsonConvert.DeserializeObject<JObject>(manifestContents);
|
||||
var packages = manifest["dependencies"] as JObject;
|
||||
if (packages == null || packages.ContainsKey(PACKAGE_NAME))
|
||||
{
|
||||
return; // we assume the package manager is still doing its thing
|
||||
}
|
||||
|
||||
packages[PACKAGE_NAME] = GIT_URL;
|
||||
File.WriteAllText(manifestFile, JsonConvert.SerializeObject(manifest, Formatting.Indented));
|
||||
|
||||
EditorApplication.delayCall += () =>
|
||||
{
|
||||
MethodInfo refresh = typeof(Client).GetMethod("Resolve",
|
||||
BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);
|
||||
if (refresh != null) refresh.Invoke(null, null);
|
||||
};
|
||||
}
|
||||
|
||||
private static void Poll()
|
||||
{
|
||||
if (Request.IsCompleted)
|
||||
{
|
||||
if (Request.Status == StatusCode.Success)
|
||||
{
|
||||
Debug.Log("Installed modular avatar framework");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(Request.Error.message);
|
||||
}
|
||||
|
||||
EditorApplication.update -= Poll;
|
||||
}
|
||||
}
|
||||
|
||||
private static SemanticVersioning.Version GetInstalledVersion()
|
||||
{
|
||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
var versionType = assembly.GetType("net.fushizen.modular_avatar.core.editor.Version", false);
|
||||
if (versionType == null) continue;
|
||||
|
||||
var versionString = versionType.GetField("VERSION", BindingFlags.Public | BindingFlags.Static);
|
||||
if (versionString == null) continue;
|
||||
|
||||
var version = versionString.GetValue(null) as string;
|
||||
return SemanticVersioning.Version.Parse(version);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ea7e474dfbc419ba053aefa9ab74a26
|
||||
timeCreated: 1661734297
|
7
Packages/net.fushizen.modular-avatar/Editor/Version.cs
Normal file
7
Packages/net.fushizen.modular-avatar/Editor/Version.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace net.fushizen.modular_avatar.core.editor
|
||||
{
|
||||
public static class Version
|
||||
{
|
||||
public const string VERSION = "0.0.1";
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d9001ce79e34e7ea114fb7e218ae09d
|
||||
timeCreated: 1661734309
|
@ -49,11 +49,13 @@ namespace net.fushizen.modular_avatar.core
|
||||
|
||||
public static void MarkDirty(UnityEngine.Object obj)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (PrefabUtility.IsPartOfPrefabInstance(obj))
|
||||
{
|
||||
PrefabUtility.RecordPrefabInstancePropertyModifications(obj);
|
||||
}
|
||||
EditorUtility.SetDirty(obj);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "net.fushizen.modular-avatar.core",
|
||||
"displayName" : "Modular Avatar - Core",
|
||||
"name" : "net.fushizen.modular-avatar",
|
||||
"displayName" : "Modular Avatar",
|
||||
"version" : "0.0.1",
|
||||
"unity" : "2019.4",
|
||||
"description" : "",
|
@ -141,8 +141,8 @@
|
||||
"com.unity.nuget.newtonsoft-json": "2.0.2"
|
||||
}
|
||||
},
|
||||
"net.fushizen.modular-avatar.core": {
|
||||
"version": "file:net.fushizen.modular-avatar.core",
|
||||
"net.fushizen.modular-avatar": {
|
||||
"version": "file:net.fushizen.modular-avatar",
|
||||
"depth": 0,
|
||||
"source": "embedded",
|
||||
"dependencies": {}
|
||||
|
124
ProjectSettings/lilToonSetting.json
Normal file
124
ProjectSettings/lilToonSetting.json
Normal file
@ -0,0 +1,124 @@
|
||||
{
|
||||
"LIL_FEATURE_ANIMATE_MAIN_UV": true,
|
||||
"LIL_FEATURE_MAIN_TONE_CORRECTION": true,
|
||||
"LIL_FEATURE_MAIN_GRADATION_MAP": true,
|
||||
"LIL_FEATURE_MAIN2ND": true,
|
||||
"LIL_FEATURE_MAIN3RD": true,
|
||||
"LIL_FEATURE_DECAL": true,
|
||||
"LIL_FEATURE_ANIMATE_DECAL": true,
|
||||
"LIL_FEATURE_LAYER_DISSOLVE": true,
|
||||
"LIL_FEATURE_ALPHAMASK": true,
|
||||
"LIL_FEATURE_SHADOW": true,
|
||||
"LIL_FEATURE_RECEIVE_SHADOW": true,
|
||||
"LIL_FEATURE_SHADOW_3RD": true,
|
||||
"LIL_FEATURE_EMISSION_1ST": true,
|
||||
"LIL_FEATURE_EMISSION_2ND": true,
|
||||
"LIL_FEATURE_ANIMATE_EMISSION_UV": true,
|
||||
"LIL_FEATURE_ANIMATE_EMISSION_MASK_UV": true,
|
||||
"LIL_FEATURE_EMISSION_GRADATION": true,
|
||||
"LIL_FEATURE_NORMAL_1ST": true,
|
||||
"LIL_FEATURE_NORMAL_2ND": true,
|
||||
"LIL_FEATURE_ANISOTROPY": true,
|
||||
"LIL_FEATURE_REFLECTION": true,
|
||||
"LIL_FEATURE_MATCAP": true,
|
||||
"LIL_FEATURE_MATCAP_2ND": true,
|
||||
"LIL_FEATURE_RIMLIGHT": true,
|
||||
"LIL_FEATURE_RIMLIGHT_DIRECTION": true,
|
||||
"LIL_FEATURE_GLITTER": true,
|
||||
"LIL_FEATURE_BACKLIGHT": true,
|
||||
"LIL_FEATURE_PARALLAX": true,
|
||||
"LIL_FEATURE_POM": true,
|
||||
"LIL_FEATURE_CLIPPING_CANCELLER": false,
|
||||
"LIL_FEATURE_DISTANCE_FADE": true,
|
||||
"LIL_FEATURE_AUDIOLINK": true,
|
||||
"LIL_FEATURE_AUDIOLINK_VERTEX": true,
|
||||
"LIL_FEATURE_AUDIOLINK_LOCAL": true,
|
||||
"LIL_FEATURE_DISSOLVE": true,
|
||||
"LIL_FEATURE_ENCRYPTION": false,
|
||||
"LIL_FEATURE_ANIMATE_OUTLINE_UV": true,
|
||||
"LIL_FEATURE_OUTLINE_TONE_CORRECTION": true,
|
||||
"LIL_FEATURE_OUTLINE_RECEIVE_SHADOW": true,
|
||||
"LIL_FEATURE_FUR_COLLISION": true,
|
||||
"LIL_FEATURE_MainGradationTex": true,
|
||||
"LIL_FEATURE_MainColorAdjustMask": true,
|
||||
"LIL_FEATURE_Main2ndTex": true,
|
||||
"LIL_FEATURE_Main2ndBlendMask": true,
|
||||
"LIL_FEATURE_Main2ndDissolveMask": true,
|
||||
"LIL_FEATURE_Main2ndDissolveNoiseMask": true,
|
||||
"LIL_FEATURE_Main3rdTex": true,
|
||||
"LIL_FEATURE_Main3rdBlendMask": true,
|
||||
"LIL_FEATURE_Main3rdDissolveMask": true,
|
||||
"LIL_FEATURE_Main3rdDissolveNoiseMask": true,
|
||||
"LIL_FEATURE_AlphaMask": true,
|
||||
"LIL_FEATURE_BumpMap": true,
|
||||
"LIL_FEATURE_Bump2ndMap": true,
|
||||
"LIL_FEATURE_Bump2ndScaleMask": true,
|
||||
"LIL_FEATURE_AnisotropyTangentMap": true,
|
||||
"LIL_FEATURE_AnisotropyScaleMask": true,
|
||||
"LIL_FEATURE_AnisotropyShiftNoiseMask": true,
|
||||
"LIL_FEATURE_ShadowBorderMask": true,
|
||||
"LIL_FEATURE_ShadowBlurMask": true,
|
||||
"LIL_FEATURE_ShadowStrengthMask": true,
|
||||
"LIL_FEATURE_ShadowColorTex": true,
|
||||
"LIL_FEATURE_Shadow2ndColorTex": true,
|
||||
"LIL_FEATURE_Shadow3rdColorTex": true,
|
||||
"LIL_FEATURE_BacklightColorTex": true,
|
||||
"LIL_FEATURE_SmoothnessTex": true,
|
||||
"LIL_FEATURE_MetallicGlossMap": true,
|
||||
"LIL_FEATURE_ReflectionColorTex": true,
|
||||
"LIL_FEATURE_ReflectionCubeTex": true,
|
||||
"LIL_FEATURE_MatCapTex": true,
|
||||
"LIL_FEATURE_MatCapBlendMask": true,
|
||||
"LIL_FEATURE_MatCapBumpMap": true,
|
||||
"LIL_FEATURE_MatCap2ndTex": true,
|
||||
"LIL_FEATURE_MatCap2ndBlendMask": true,
|
||||
"LIL_FEATURE_MatCap2ndBumpMap": true,
|
||||
"LIL_FEATURE_RimColorTex": true,
|
||||
"LIL_FEATURE_GlitterColorTex": true,
|
||||
"LIL_FEATURE_GlitterShapeTex": true,
|
||||
"LIL_FEATURE_EmissionMap": true,
|
||||
"LIL_FEATURE_EmissionBlendMask": true,
|
||||
"LIL_FEATURE_EmissionGradTex": true,
|
||||
"LIL_FEATURE_Emission2ndMap": true,
|
||||
"LIL_FEATURE_Emission2ndBlendMask": true,
|
||||
"LIL_FEATURE_Emission2ndGradTex": true,
|
||||
"LIL_FEATURE_ParallaxMap": true,
|
||||
"LIL_FEATURE_AudioLinkMask": true,
|
||||
"LIL_FEATURE_AudioLinkLocalMap": true,
|
||||
"LIL_FEATURE_DissolveMask": true,
|
||||
"LIL_FEATURE_DissolveNoiseMask": true,
|
||||
"LIL_FEATURE_OutlineTex": true,
|
||||
"LIL_FEATURE_OutlineWidthMask": true,
|
||||
"LIL_FEATURE_OutlineVectorTex": true,
|
||||
"LIL_FEATURE_FurNoiseMask": true,
|
||||
"LIL_FEATURE_FurMask": true,
|
||||
"LIL_FEATURE_FurLengthMask": true,
|
||||
"LIL_FEATURE_FurVectorTex": true,
|
||||
"LIL_OPTIMIZE_APPLY_SHADOW_FA": true,
|
||||
"LIL_OPTIMIZE_USE_FORWARDADD": true,
|
||||
"LIL_OPTIMIZE_USE_FORWARDADD_SHADOW": false,
|
||||
"LIL_OPTIMIZE_USE_VERTEXLIGHT": true,
|
||||
"LIL_OPTIMIZE_USE_LIGHTMAP": false,
|
||||
"isLocked": false,
|
||||
"isDebugOptimize": false,
|
||||
"isOptimizeInTestBuild": false,
|
||||
"defaultAsUnlit": 0.0,
|
||||
"defaultVertexLightStrength": 0.0,
|
||||
"defaultLightMinLimit": 0.05000000074505806,
|
||||
"defaultLightMaxLimit": 1.0,
|
||||
"defaultBeforeExposureLimit": 10000.0,
|
||||
"defaultMonochromeLighting": 0.0,
|
||||
"defaultlilDirectionalLightStrength": 1.0,
|
||||
"presetSkin": {
|
||||
"instanceID": 0
|
||||
},
|
||||
"presetFace": {
|
||||
"instanceID": 0
|
||||
},
|
||||
"presetHair": {
|
||||
"instanceID": 0
|
||||
},
|
||||
"presetCloth": {
|
||||
"instanceID": 0
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user