/// <summary> /// 加载Json /// </summary> /// <param name="json"></param> public void JsonDo(IJsonNode json) { if (json.Contains("tweenType")) { m_tweenType = json.GetInt("tweenType"); } // end if if (json.Contains("tweenElement")) { m_tweenElement = (JTweenElement)json.GetInt("tweenElement"); } // end if if (json.Contains("name")) { m_name = json.GetString("name"); } // end if if (json.Contains("delay")) { m_delay = json.GetFloat("delay"); } // end if if (json.Contains("duration")) { m_duration = json.GetFloat("duration"); } // end if if (json.Contains("snapping")) { m_isSnapping = json.GetBool("snapping"); } // end if if (json.Contains("animCurve")) { m_animCurve = JTweenUtils.JsonAnimationCurve(json.GetNode("animCurve")); } // end if if (json.Contains("animEase")) { m_animEase = (Ease)json.GetInt("animEase"); } // end if if (json.Contains("loopCount")) { m_loopCount = json.GetInt("loopCount"); } // end if if (json.Contains("loopType")) { m_loopType = (LoopType)json.GetInt("loopType"); } // end if JsonTo(json); }
/// <summary> /// 加载Json /// </summary> /// <param name="json"></param> public void JsonDo(JsonData json) { if (json.Contains("tweenType")) m_tweenType = json["tweenType"].ToInt32(); // end if if (json.Contains("tweenElement")) m_tweenElement = (JTweenElement)json["tweenElement"].ToInt32(); // end if if (json.Contains("name")) m_name = json["name"].ToString(); // end if if (json.Contains("duration")) m_duration = json["duration"].ToFloat(); // end if if (json.Contains("snapping")) m_isSnapping = json["snapping"].ToBool(); // end if if (json.Contains("animCurve")) m_animCurve = JTweenUtils.JsonAnimationCurve(json["animCurve"]); // end if if (json.Contains("animEase")) m_animEase = (Ease)json["animEase"].ToInt32(); // end if if (json.Contains("loopCount")) m_loopCount = json["loopCount"].ToInt32(); // end if if (json.Contains("loopType")) m_loopType = (LoopType)json["loopType"].ToInt32(); // end if JsonTo(json); }
public static JTweenBase CreateTween(int tweenElement, int tweenType) { JTweenElement type = (JTweenElement)tweenElement; switch (type) { case JTweenElement.AudioSource: return(CreateAudioSourceTween(tweenType)); case JTweenElement.Camera: return(CreateCameraTween(tweenType)); case JTweenElement.Light: return(CreateLightTween(tweenType)); case JTweenElement.LineRenderer: return(CreateLineRendererTween(tweenType)); case JTweenElement.Material: return(CreateMaterialTween(tweenType)); case JTweenElement.Rigidbody: return(CreateRigidbodyTween(tweenType)); case JTweenElement.Rigidbody2D: return(CreateRigidbody2DTween(tweenType)); case JTweenElement.SpriteRenderer: return(CreateSpriteRendererTween(tweenType)); case JTweenElement.TrailRenderer: return(CreateTrailRendererTween(tweenType)); case JTweenElement.Transform: return(CreateTransformTween(tweenType)); case JTweenElement.CanvasGroup: return(CreateCanvasGroupTween(tweenType)); case JTweenElement.Graphic: return(CreateGraphicTween(tweenType)); case JTweenElement.Image: return(CreateImageTween(tweenType)); case JTweenElement.LayoutElement: return(CreateLayoutElementTween(tweenType)); case JTweenElement.Outline: return(CreateOutlineTween(tweenType)); case JTweenElement.RectTransform: return(CreateRectTransformTween(tweenType)); case JTweenElement.ScrollRect: return(CreateScrollRectTween(tweenType)); case JTweenElement.Slider: return(CreateSliderTween(tweenType)); case JTweenElement.Text: return(CreateTextTween(tweenType)); default: UnityEngine.Debug.LogError("CreateTween tweenElement is " + type.ToString()); return(null); } // end swtich }