GLTFScene.cs 656 B

12345678910111213141516171819202122232425262728
  1. using System.Collections.Generic;
  2. using System.Runtime.Serialization;
  3. namespace GLTFExport.Entities
  4. {
  5. [DataContract]
  6. public class GLTFScene : GLTFChildRootProperty
  7. {
  8. [DataMember(EmitDefaultValue = false)]
  9. public int[] nodes { get; set; }
  10. public List<int> NodesList { get; private set; }
  11. public GLTFScene()
  12. {
  13. NodesList = new List<int>();
  14. }
  15. public void Prepare()
  16. {
  17. // Do not export empty arrays
  18. if (NodesList.Count > 0)
  19. {
  20. nodes = NodesList.ToArray();
  21. }
  22. }
  23. }
  24. }