public static BoxColliderData BoxColliderDataFromSource(BoxCollider target) { BoxColliderData data = new BoxColliderData(); data.n = "BoxCollider"; data.center = Vector3Data.Vector3DataFromSource(target.center); data.size = Vector3Data.Vector3DataFromSource(target.size); return(data); }
public static ComponentData ComponentDataFromSource(Component target, Hammurabi serializer) { if (target is Transform) { return(TransformData.TransformDataFromSource(target as Transform)); } if (target is Camera) { return(CameraData.CameraDataFromSource(target as Camera)); } if (target is Light) { return(LightData.LightDataFromSource(target as Light)); } if (target is MeshFilter) { return(MeshFilterData.MeshFilterDataFromSource(target as MeshFilter)); } if (target is MeshRenderer) { return(MeshRendererData.MeshRendererDataFromSource(target as MeshRenderer)); } if (target is Rigidbody) { return(RigidbodyData.RigidbodyDataFromSource(target as Rigidbody)); } if (target is BoxCollider) { return(BoxColliderData.BoxColliderDataFromSource(target as BoxCollider)); } if (target is MonoBehaviour) { return(MonoBehaviourData.MonoBehaviourDataFromSource(target as MonoBehaviour, serializer)); } return(new ComponentData()); }