예제 #1
0
        public static LightData LightDataFromSource(Light target)
        {
            LightData data = new LightData();

            data.n         = "Light";
            data.color     = ColorData.ColorDataFromSource(target.color);
            data.intensity = target.intensity;
            data.range     = target.range;
            data.type      = target.type;
            data.spotAngle = target.spotAngle;
            return(data);
        }
예제 #2
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());
 }