mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 04:19:42 -05:00
add texture transform extensions format
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UniJSON;
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
[Serializable]
|
||||
public class glTF_KHR_texture_transform : JsonSerializableBase
|
||||
{
|
||||
public static string ExtensionName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "KHR_texture_transform";
|
||||
}
|
||||
}
|
||||
|
||||
[JsonSchema(MinItems = 2, MaxItems = 2)]
|
||||
public float[] offset = new float[2] { 0.0f, 0.0f };
|
||||
|
||||
public float rotation;
|
||||
|
||||
[JsonSchema(MinItems = 2, MaxItems = 2)]
|
||||
public float[] scale = new float[2] { 1.0f, 1.0f };
|
||||
|
||||
[ItemJsonSchema(Minimum = 0)]
|
||||
public int texCoord;
|
||||
|
||||
protected override void SerializeMembers(GLTFJsonFormatter f)
|
||||
{
|
||||
f.KeyValue(() => offset);
|
||||
f.KeyValue(() => rotation);
|
||||
f.KeyValue(() => scale);
|
||||
f.KeyValue(() => texCoord);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class glTFTextureInfo_extensions : ExtensionsBase<glTFTextureInfo_extensions>
|
||||
{
|
||||
[JsonSchema(Required = true)]
|
||||
public glTF_KHR_texture_transform KHR_texture_transform;
|
||||
|
||||
[JsonSerializeMembers]
|
||||
void SerializeMembers_unlit(GLTFJsonFormatter f)
|
||||
{
|
||||
if (KHR_texture_transform != null)
|
||||
{
|
||||
f.KeyValue(() => KHR_texture_transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04b631e1572e84d47b88aebc3631865b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -28,13 +28,17 @@ namespace UniGLTF
|
||||
public int texCoord;
|
||||
|
||||
// empty schemas
|
||||
public object extensions;
|
||||
public glTFTextureInfo_extensions extensions;
|
||||
public object extras;
|
||||
|
||||
protected override void SerializeMembers(GLTFJsonFormatter f)
|
||||
{
|
||||
f.KeyValue(() => index);
|
||||
f.KeyValue(() => texCoord);
|
||||
if (extensions != null)
|
||||
{
|
||||
f.KeyValue(() => extensions);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract glTFTextureTypes TextreType { get; }
|
||||
|
||||
Reference in New Issue
Block a user