Пример #1
0
        public static AXCamera AXCameraFromJSON(AX.SimpleJSON.JSONNode jn)
        {
            AXCamera axcam = new AXCamera();


            axcam.alpha          = jn["alpha"].AsFloat;
            axcam.beta           = jn["beta"].AsFloat;
            axcam.radius         = jn["radius"].AsFloat;
            axcam.radiusAdjuster = jn["radiusAdjuster"].AsFloat;

            return(axcam);
        }
Пример #2
0
        // JSON SERIALIZATION
        public static string AXCameraAsJSON(AXCamera axcam)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("{");

            sb.Append(" \"alpha\":\"" + axcam.alpha + "\"");
            sb.Append(",\"beta\":\"" + axcam.beta + "\"");
            sb.Append(",\"radius\":\"" + axcam.radius + "\"");
            sb.Append(",\"radiusAdjuster\":\"" + axcam.radiusAdjuster + "\"");


            // finish
            sb.Append("}");             // end parametri_object

            return(sb.ToString());
        }