Example #1
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginAnchorPos", JTweenUtils.Vector2Json(m_beginAnchorPos));
     json.SetNode("punch", JTweenUtils.Vector2Json(m_punch));
     json.SetInt("vibrato", m_vibrato);
     json.SetFloat("elasticity", m_elasticity);
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginRotation", JTweenUtils.Vector3Json(m_beginRotation));
     json.SetNode("punch", JTweenUtils.Vector3Json(m_toPunch));
     json.SetInt("vibrate", m_vibrate);
     json.SetFloat("elasticity", m_elasticity);
 }
        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);
        }
Example #4
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginRotate", JTweenUtils.Vector3Json(m_beginRotate));
     json.SetNode("towards", JTweenUtils.Vector3Json(m_towards));
     json.SetInt("axis", (int)m_axisConstraint);
     json.SetNode("up", JTweenUtils.Vector3Json(m_up));
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginAnchorPos", JTweenUtils.Vector2Json(BeginAnchorPos));
     json.SetNode("anchorPos", JTweenUtils.Vector2Json(ToAnchorPos));
     json.SetFloat("jumpPower", JumpPower);
     json.SetInt("numJumps", NumJumps);
 }
Example #6
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("vector", JTweenUtils.Vector4Json(m_toVector));
     if (!string.IsNullOrEmpty(m_property))
     {
         json.SetString("property", m_property);
     } // end if
     if (-1 != m_propertyID)
     {
         json.SetInt("propertyID", m_propertyID);
     } // end if
 }
Example #8
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginColor", JTweenUtils.ColorJson(m_beginColor));
     json.SetFloat("alpha", m_toAlpha);
     if (!string.IsNullOrEmpty(m_property))
     {
         json.SetString("property", m_property);
     } // end if
     if (-1 != m_propertyID)
     {
         json.SetInt("propertyID", m_propertyID);
     } // end if
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetFloat("beginFloat", m_beginFloat);
     json.SetFloat("float", m_toFloat);
     if (!string.IsNullOrEmpty(m_property))
     {
         json.SetString("property", m_property);
     } // end if
     if (-1 != m_propertyID)
     {
         json.SetInt("propertyID", m_propertyID);
     } // end if
 }
Example #10
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);
        }
        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);
        }