예제 #1
0
 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());
 }