SpatialGameObjectData.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using UnityEngine;
  6. [Serializable]
  7. public class SpatialGameObjectData
  8. {
  9. [SerializeField]
  10. private string prefabName;
  11. [SerializeField]
  12. private Vector3 localPosition;
  13. [SerializeField]
  14. private Quaternion localRotation;
  15. [SerializeField]
  16. private Vector3 localScale;
  17. public SpatialGameObjectData()
  18. {
  19. }
  20. public void SetPrefabName(string prefabName)
  21. {
  22. this.prefabName = prefabName;
  23. }
  24. public string GetPrefabName()
  25. {
  26. return this.prefabName;
  27. }
  28. public void SetTransformData(Vector3 localPosition, Quaternion localRotation, Vector3 localScale)
  29. {
  30. this.localPosition = localPosition;
  31. this.localRotation = localRotation;
  32. this.localScale = localScale;
  33. }
  34. public void GetTransformData(ref Vector3 localPosition, ref Quaternion localRotation, ref Vector3 localScale)
  35. {
  36. localPosition = this.localPosition;
  37. localRotation = this.localRotation;
  38. localScale = this.localScale;
  39. }
  40. }