mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-21 06:27:29 -05:00
parent
6ebeb8b3d4
commit
16e4bcab44
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 117159fa2bfe3824689e2566a48ea457
|
||||
guid: 5f7b7c8fb7bd5f244a45e72845748d31
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
|
@ -5,15 +5,38 @@ using UnityEngine;
|
|||
|
||||
namespace UniVRM10
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
|
||||
public enum ShaderPropertyType
|
||||
{
|
||||
//
|
||||
// 概要:
|
||||
// Color Property.
|
||||
Color = 0,
|
||||
//
|
||||
// 概要:
|
||||
// Vector Property.
|
||||
Vector = 1,
|
||||
//
|
||||
// 概要:
|
||||
// Float Property.
|
||||
Float = 2,
|
||||
//
|
||||
// 概要:
|
||||
// Range Property.
|
||||
Range = 3,
|
||||
//
|
||||
// 概要:
|
||||
// Texture Property.
|
||||
TexEnv = 4
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct PropItem
|
||||
{
|
||||
public string Name;
|
||||
public ShaderUtil.ShaderPropertyType PropertyType;
|
||||
public ShaderPropertyType PropertyType;
|
||||
public Vector4 DefaultValues;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Material 一つ分のプロパティを蓄えている
|
||||
|
|
@ -68,7 +91,7 @@ namespace UniVRM10
|
|||
item.PropMap.Add(bindType, new PropItem
|
||||
{
|
||||
Name = name,
|
||||
PropertyType = propType,
|
||||
PropertyType = (UniVRM10.ShaderPropertyType)Enum.Parse(typeof(UniVRM10.ShaderPropertyType), propType.ToString(), true),
|
||||
DefaultValues = material.GetColor(name),
|
||||
});
|
||||
propNames.Add(name);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 90ee9936998e23342978b06befb3d9dd
|
||||
guid: 713446847d9e57341828430ee0f79ad2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ using UniJSON;
|
|||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using VrmLib.Diff;
|
||||
using static UnityEditor.ShaderUtil;
|
||||
|
||||
namespace UniVRM10
|
||||
{
|
||||
|
|
@ -112,8 +111,8 @@ namespace UniVRM10
|
|||
|
||||
switch (ShaderUtil.GetPropertyType(lhs.shader, i))
|
||||
{
|
||||
case ShaderPropertyType.Color:
|
||||
case ShaderPropertyType.Vector:
|
||||
case UnityEditor.ShaderUtil.ShaderPropertyType.Color:
|
||||
case UnityEditor.ShaderUtil.ShaderPropertyType.Vector:
|
||||
{
|
||||
var l = lhs.GetVector(prop);
|
||||
var r = rhs.GetVector(prop);
|
||||
|
|
@ -124,8 +123,8 @@ namespace UniVRM10
|
|||
}
|
||||
break;
|
||||
|
||||
case ShaderPropertyType.Float:
|
||||
case ShaderPropertyType.Range:
|
||||
case UnityEditor.ShaderUtil.ShaderPropertyType.Float:
|
||||
case UnityEditor.ShaderUtil.ShaderPropertyType.Range:
|
||||
{
|
||||
var l = lhs.GetFloat(prop);
|
||||
var r = rhs.GetFloat(prop);
|
||||
|
|
@ -136,7 +135,7 @@ namespace UniVRM10
|
|||
}
|
||||
break;
|
||||
|
||||
case ShaderPropertyType.TexEnv:
|
||||
case UnityEditor.ShaderUtil.ShaderPropertyType.TexEnv:
|
||||
{
|
||||
var l = lhs.GetTextureOffset(prop);
|
||||
var r = rhs.GetTextureOffset(prop);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user