Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. using Sirenix.Serialization;
  6.  
  7. public interface IWaypoint
  8. {
  9. List<Connection> Connections { set; get; }
  10.  
  11. Vector3 Position { set; get; }
  12. }
  13.  
  14. [System.Serializable]
  15. public class Connection
  16. {
  17. public bool AnchorPoint;
  18. public Vector3 AnchorPosition;
  19. [OdinSerialize, ShowInInspector] public IWaypoint Waypoint;
  20. }
  21.  
  22. public class Test : SerializedMonoBehaviour, IWaypoint
  23. {
  24. List<Connection> myConnection = new List<Connection>();
  25. [HideInInspector]
  26. Vector3 myPosition = new Vector3(1.0f, 1.0f, 1.0f);
  27.  
  28. [OdinSerialize, ShowInInspector]
  29. List<Connection> IWaypoint.Connections
  30. {
  31. get { return myConnection; }
  32. set { myConnection = value; }
  33. }
  34.  
  35. [OdinSerialize, ShowInInspector]
  36. Vector3 IWaypoint.Position
  37. {
  38. get { return myPosition; }
  39. set { myPosition = value; }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement