protected override void JsonTo(IJsonNode json) { if (json.Contains("beginAnchorPos")) { BeginAnchorPos = JTweenUtils.JsonToVector2(json.GetNode("beginAnchorPos")); } // end if if (json.Contains("pos")) { m_posType = PosTypeEnum.Pos; m_toAnchorPos = JTweenUtils.JsonToVector2(json.GetNode("pos")); } else if (json.Contains("posX")) { m_posType = PosTypeEnum.PosX; m_toAnchorPosX = json.GetFloat("posX"); } else if (json.Contains("posY")) { m_posType = PosTypeEnum.PosY; m_toAnchorPosY = json.GetFloat("posY"); } else { Debug.LogError(GetType().FullName + " JsonTo PosType is null"); } // end if Restore(); }
protected override void JsonTo(JsonData json) { if (json.Contains("beginAnchorPos")) { BeginAnchorPos = JTweenUtils.JsonToVector3(json["beginAnchorPos"]); } // end if if (json.Contains("pos")) { m_posType = PosTypeEnum.Pos; m_toAnchorPos = JTweenUtils.JsonToVector3(json["pos"]); } else if (json.Contains("posX")) { m_posType = PosTypeEnum.PosX; m_toAnchorPosX = (float)json["posX"]; } else if (json.Contains("posY")) { m_posType = PosTypeEnum.PosY; m_toAnchorPosY = (float)json["posY"]; } else if (json.Contains("posZ")) { m_posType = PosTypeEnum.PosZ; m_toAnchorPosZ = (float)json["posZ"]; } else { Debug.LogError(GetType().FullName + " JsonTo PosType is null"); } // end if Restore(); }