Beispiel #1
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetString("beginStr", m_beginStr);
     json.SetString("str", m_toStr);
     json.SetBool("rich", m_richTextEnabled);
     json.SetInt("mode", (int)m_scrambleMode);
     json.SetString("char", m_scrambleChars);
 }
        protected override void ToJson(ref IJsonNode json)
        {
            json.SetNode("beginPosition", JTweenUtils.Vector3Json(m_beginPosition));
            IJsonNode pathJson = JsonHelper.CreateNode();

            for (int i = 0; i < m_toPath.Length; ++i)
            {
                pathJson.Add(JTweenUtils.Vector3Json(m_toPath[i]));
            } // end for
            json.SetNode("path", pathJson);
            json.SetInt("type", (int)m_pathType);
            json.SetInt("mode", (int)m_pathMode);
            json.SetInt("resolution", m_resolution);
            json.SetNode("gizmoColor", JTweenUtils.ColorJson(m_gizmoColor));
            json.SetBool("showGizmo", m_showGizmo);
        }
        protected override void ToJson(ref IJsonNode json)
        {
            json.SetNode("beginAnchorPos", JTweenUtils.Vector2Json(m_beginAnchorPos));
            switch (m_shakeType)
            {
            case ShakeTypeEnum.Value:
                json.SetFloat("strength", m_strength);
                break;

            case ShakeTypeEnum.Axis:
                json.SetNode("strengthAxis", JTweenUtils.Vector2Json(m_strengthAxis));
                break;

            default:
                Debug.LogError(GetType().FullName + " ToJson ShakeType is null");
                break;
            } // end swtich
            json.SetInt("vibrato", m_vibrato);
            json.SetFloat("randomness", m_randomness);
            json.SetBool("fadeOut", m_fadeOut);
        }
Beispiel #4
0
        /// <summary>
        /// 转成Json
        /// </summary>
        public IJsonNode DoJson()
        {
            IJsonNode json = JsonHelper.CreateNode();

            if (m_tweenType != 0)
            {
                json.SetInt("tweenType", m_tweenType);
            }
            // end if
            json.SetInt("tweenElement", (int)m_tweenElement);
            if (!string.IsNullOrEmpty(m_name))
            {
                json.SetString("name", m_name);
            }
            // end if
            json.SetDouble("duration", Math.Round(m_duration, 4));
            if (m_delay > 0.00009f)
            {
                json.SetDouble("delay", Math.Round(m_delay, 4));
            }
            // end if
            json.SetBool("snapping", m_isSnapping);
            if (m_animCurve != null && m_animCurve.keys != null && m_animCurve.keys.Length > 0)
            {
                json.SetNode("animCurve", JTweenUtils.AnimationCurveJson(m_animCurve));
            }
            else
            {
                json.SetInt("animEase", (int)m_animEase);
            } // end if
            if (m_loopCount > 0)
            {
                json.SetInt("loopCount", m_loopCount);
                json.SetInt("loopType", (int)m_loopType);
            } // end if
            ToJson(ref json);
            return(json);
        }