Ejemplo n.º 1
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);
 }
Ejemplo n.º 3
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("beginStartColor", JTweenUtils.ColorJson(m_beginStartColor));
     json.SetNode("beginEndColor", JTweenUtils.ColorJson(m_beginEndColor));
     json.SetNode("toStartColor", JTweenUtils.ColorJson(m_toStartColor));
     json.SetNode("toEndColor", JTweenUtils.ColorJson(m_toEndColor));
 }
 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));
     json.SetNode("endValue", JTweenUtils.Vector3Json(m_toPosition));
     json.SetFloat("jumpPower", m_jumpPower);
     json.SetInt("numJumps", m_numJumps);
 }
        protected override void ToJson(ref IJsonNode json)
        {
            json.SetNode("beginPosition", JTweenUtils.Vector3Json(m_beginPosition));
            switch (m_MoveType)
            {
            case MoveTypeEnum.Move:
                json.SetNode("move", JTweenUtils.Vector3Json(m_toPosition));
                break;

            case MoveTypeEnum.MoveX:
                json.SetFloat("moveX", m_toMoveX);
                break;

            case MoveTypeEnum.MoveY:
                json.SetFloat("moveY", m_toMoveY);
                break;

            case MoveTypeEnum.MoveZ:
                json.SetFloat("moveZ", m_toMoveZ);
                break;

            default:
                Debug.LogError(GetType().FullName + " ToJson MoveType is null");
                break;
            } // end swtich
        }
Ejemplo n.º 8
0
        protected override void ToJson(ref IJsonNode json)
        {
            json.SetNode("beginAnchorPos", JTweenUtils.Vector3Json(BeginAnchorPos));
            switch (m_posType)
            {
            case PosTypeEnum.Pos:
                json.SetNode("pos", JTweenUtils.Vector3Json(m_toAnchorPos));
                break;

            case PosTypeEnum.PosX:
                json.SetFloat("posX", m_toAnchorPosX);
                break;

            case PosTypeEnum.PosY:
                json.SetFloat("posY", m_toAnchorPosY);
                break;

            case PosTypeEnum.PosZ:
                json.SetFloat("posZ", m_toAnchorPosZ);
                break;

            default:
                Debug.LogError(GetType().FullName + " ToJson PosType is null");
                break;
            } // end swtich
        }
Ejemplo n.º 9
0
        protected override void ToJson(ref IJsonNode json)
        {
            Vector4 rect = new Vector4(m_beginRect.x, m_beginRect.y, m_beginRect.width, m_beginRect.height);

            json.SetNode("beginRect", JTweenUtils.Vector4Json(rect));
            rect = new Vector4(m_toRect.x, m_toRect.y, m_toRect.width, m_toRect.height);
            json.SetNode("rect", JTweenUtils.Vector4Json(rect));
        }
Ejemplo n.º 10
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginColor", JTweenUtils.ColorJson(m_beginColor));
     json.SetNode("color", JTweenUtils.ColorJson(m_toColor));
     if (!string.IsNullOrEmpty(m_property))
     {
         json.SetString("property", m_property);
     } // end if
     if (-1 != m_propertyID)
     {
         json.SetInt("propertyID", m_propertyID);
     } // end if
 }
Ejemplo n.º 11
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginOffset", JTweenUtils.Vector2Json(m_beginOffset));
     json.SetNode("offset", JTweenUtils.Vector2Json(m_toOffset));
     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.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);
        }
Ejemplo n.º 13
0
        protected override void ToJson(ref IJsonNode json)
        {
            switch (m_ScaleType)
            {
            case ScaleTypeEnum.Scale:
                json.SetNode("scale", JTweenUtils.Vector3Json(m_toScale));
                break;

            case ScaleTypeEnum.ScaleV:
                json.SetFloat("scaleV", m_toScaleV);
                break;

            case ScaleTypeEnum.ScaleX:
                json.SetFloat("scaleX", m_toScaleX);
                break;

            case ScaleTypeEnum.ScaleY:
                json.SetFloat("scaleY", m_toScaleY);
                break;

            case ScaleTypeEnum.ScaleZ:
                json.SetFloat("scaleZ", m_toScaleZ);
                break;

            default:
                Debug.LogError(GetType().FullName + " ToJson MoveType is null");
                break;
            } // end swtich
        }
        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);
        }
        protected override void ToJson(ref IJsonNode json)
        {
            json.SetNode("beginPivot", JTweenUtils.Vector2Json(m_beginPivot));
            switch (m_pivotType)
            {
            case PivotTypeEnum.Pivot:
                json.SetNode("pivot", JTweenUtils.Vector2Json(m_toPivot));
                break;

            case PivotTypeEnum.PivotX:
                json.SetFloat("pivotX", m_toPivotX);
                break;

            case PivotTypeEnum.PivotY:
                json.SetFloat("pivotY", m_toPivotY);
                break;

            default:
                Debug.LogError(GetType().FullName + " ToJson PosType is null");
                break;
            } // end swtich
        }
Ejemplo n.º 16
0
        public static IJsonNode AnimationCurveJson(AnimationCurve arg)
        {
            IJsonNode ret      = JsonHelper.CreateNode();
            IJsonNode jsonKeys = JsonHelper.CreateNode();

            Keyframe[] keys = arg.keys;
            for (int i = 0, imax = keys.Length; i < imax; ++i)
            {
                Keyframe  k      = keys[i];
                IJsonNode oneKey = JsonHelper.CreateNode();
                ret.SetDouble("T", System.Math.Round(k.time, 4));
                ret.SetDouble("V", System.Math.Round(k.value, 4));
                ret.SetDouble("I", System.Math.Round(k.inTangent, 4));
                ret.SetDouble("O", System.Math.Round(k.outTangent, 4));
                ret.SetInt("M", k.tangentMode);
                jsonKeys.Add(oneKey);
            }
            ret.SetNode("keys", jsonKeys);
            ret.SetInt("pre", (int)arg.preWrapMode);
            ret.SetInt("post", (int)arg.postWrapMode);
            return(ret);
        }
Ejemplo n.º 17
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);
        }
Ejemplo n.º 18
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("scale", JTweenUtils.Vector3Json(m_byScale));
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("rotate", JTweenUtils.Vector3Json(m_toRotate));
     json.SetInt("mode", (int)m_RotateMode);
 }
Ejemplo n.º 20
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginAnchorMax", JTweenUtils.Vector2Json(m_beginAnchorMax));
     json.SetNode("anchorMax", JTweenUtils.Vector2Json(m_toAnchorMax));
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginSizeDelta", JTweenUtils.Vector2Json(m_beginSizeDelta));
     json.SetNode("size", JTweenUtils.Vector2Json(m_toSizeDelta));
 }
Ejemplo n.º 22
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginColor", JTweenUtils.ColorJson(m_beginColor));
     json.SetFloat("alpha", m_toAlpha);
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("rotate", JTweenUtils.Vector3Json(m_byRotate));
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("move", JTweenUtils.Vector3Json(m_byPosition));
 }
        protected override void ToJson(ref IJsonNode json)
        {
            Vector4 quaternion = new Vector4(m_toRotate.x, m_toRotate.y, m_toRotate.z, m_toRotate.w);

            json.SetNode("quaternion", JTweenUtils.Vector4Json(quaternion));
        }
Ejemplo n.º 26
0
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginColor", JTweenUtils.ColorJson(m_beginColor));
     json.SetNode("color", JTweenUtils.ColorJson(m_toColor));
 }
 protected override void ToJson(ref IJsonNode json)
 {
     json.SetNode("beginNormalizedPos", JTweenUtils.Vector2Json(m_beginNormalizedPos));
     json.SetNode("pos", JTweenUtils.Vector2Json(m_toNormalizedPos));
 }