forked from alvani/Unity-glTF-Exporter
-
Notifications
You must be signed in to change notification settings - Fork 14
/
GlTF_Channel.cs
32 lines (28 loc) · 667 Bytes
/
GlTF_Channel.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
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
public class GlTF_Channel : GlTF_Writer {
public int samplerIndex = -1;
public GlTF_Target target;
public GlTF_Channel (string ch, int sIndex) {
samplerIndex = sIndex;
}
public override void Write()
{
if(samplerIndex == -1)
{
Debug.LogError("Error when serializing gltf Channel for target: " + target.id);
return;
}
IndentIn();
Indent(); jsonWriter.Write ("{\n");
IndentIn();
Indent(); jsonWriter.Write ("\"sampler\": " + samplerIndex + ",\n");
target.Write ();
jsonWriter.WriteLine();
IndentOut();
Indent(); jsonWriter.Write ("}");
IndentOut();
}
}
#endif