forked from alvani/Unity-glTF-Exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlTF_Texture.cs
40 lines (37 loc) · 1.16 KB
/
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
39
40
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 format = 6408;
public int internalFormat = 6408;
public string samplerName;
public string source;
public int target = 3553;
public int tType = 5121;
public static string GetNameFromObject(Object o)
{
return "texture_" + GlTF_Writer.GetNameFromObject(o, true);
}
public override void Write()
{
Indent(); jsonWriter.Write ("\"" + name + "\": {\n");
IndentIn();
Indent(); jsonWriter.Write ("\"format\": " + format + ",\n");
Indent(); jsonWriter.Write ("\"internalFormat\": " + internalFormat + ",\n");
Indent(); jsonWriter.Write ("\"sampler\": \"" + samplerName + "\",\n");
Indent(); jsonWriter.Write ("\"source\": \"" + source + "\",\n");
Indent(); jsonWriter.Write ("\"target\": " + target + ",\n");
Indent(); jsonWriter.Write ("\"type\": " + tType + "\n");
IndentOut();
Indent(); jsonWriter.Write ("}");
}
}