forked from alvani/Unity-glTF-Exporter
-
Notifications
You must be signed in to change notification settings - Fork 14
/
GlTF_Texture.cs
38 lines (33 loc) · 768 Bytes
/
GlTF_Texture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
public class GlTF_Texture : GlTF_Writer {
/*
"texture_O21_jpg": {
"format": 6408,
"internalFormat": 6408,
"sampler": "sampler_0",
"source": "O21_jpg",
"target": 3553,
"type": 5121
},
*/
public int samplerIndex;
public int source;
public bool flipy = true;
public static string GetNameFromObject(Object o)
{
return "texture_" + GlTF_Writer.GetNameFromObject(o, true);
}
public override void Write()
{
Indent(); jsonWriter.Write ("{\n");
IndentIn();
writeExtras();
Indent(); jsonWriter.Write ("\"sampler\": " + samplerIndex + ",\n");
Indent(); jsonWriter.Write ("\"source\": " + source + "\n");
IndentOut();
Indent(); jsonWriter.Write ("}");
}
}
#endif