public static AmbientHitableObject Deserialize(JObject jObject) { AmbientHitableObject ambientHitableObject = ReflectionUtils.CallPrivateConstructor <AmbientHitableObject>(); Deserialize(ref jObject, ambientHitableObject); ambientHitableObject.Init(); return(ambientHitableObject); }
public static AmbientHitableObject Create(WorldPosition worldPosition, AmbientHitableObjectType ambientHitableObjectType) { AmbientHitableObject ambientHitableObject = new AmbientHitableObject(worldPosition) { AmbientHitableObjectType = ambientHitableObjectType.ID, CustomProperties = ambientHitableObjectType.CustomProperties != null ? (JObject)ambientHitableObjectType.CustomProperties.DeepClone() : null, YPositionDepthOffset = ambientHitableObjectType.YPositionDepthOffset, LiveSpan = ambientHitableObjectType.LiveSpan, }; ambientHitableObject.SetBlocking(ambientHitableObjectType.IsBlocking); ambientHitableObject.SetHitable(ambientHitableObjectType.IsHitable); ambientHitableObject.Init(); return(ambientHitableObject); }