/*WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW*\ ( ( ) )
|/ \| ) ) _((_
|| (c) Wanzyee Studio < wanzyeestudio.blogspot.com > || ( ( |_ _ |=n
|\ /| _____)) | ! ] U
\.ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ./ (_(__(S) |___*/
using UnityEngine;
namespace WanzyeeStudio.Json{
///
/// Custom Newtonsoft.Json.JsonConverter for UnityEngine.Bounds.
///
public class BoundsConverter : PartialConverter{
///
/// Prevent the properties from being stripped.
///
/*
* https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html
* Instead of an extra file, work around by making and accessing a dummy instance.
*/
private void PreserveProperties(){
var _dummy = new Bounds();
_dummy.center = _dummy.center;
_dummy.extents = _dummy.extents;
}
///
/// Get the property names include center, extents.
///
/// The property names.
protected override string[] GetPropertyNames(){
return new []{"center", "extents"};
}
}
}