Esempio n. 1
0
        public IJsonNode DoJson()
        {
            IJsonNode json = JsonHelper.CreateNode();

            if (m_tweens != null && m_tweens.Length > 0)
            {
                IJsonNode node;
                for (int i = 0; i < m_tweens.Length; i++)
                {
                    JTweenBase tween = m_tweens[i];
                    node = tween.DoJson();
                    string curPath = JTweenUtils.GetTranPath(transform) + "/";
                    if (tween.Target != transform)
                    {
                        string targetPath = JTweenUtils.GetTranPath(tween.Target);
                        if (!targetPath.StartsWith(curPath))
                        {
                            Debug.LogErrorFormat("JTweenSequence DoJson target is not child! Path:{0}", targetPath);
                            continue;
                        } // end if
                        node.SetString("_PATH", JTweenUtils.GetTranPath(tween.Target).Replace(curPath, ""));
                    }     // end if
                    json.Add(node);
                }
            }
            return(json);
        }
Esempio n. 2
0
        public JsonData DoJson()
        {
            JsonData json = new JsonData();

            if (m_tweens != null && m_tweens.Length > 0)
            {
                JsonData node;
                foreach (var tween in m_tweens)
                {
                    node = tween.DoJson();
                    string curPath = JTweenUtils.GetTranPath(transform) + "/";
                    if (tween.Target != transform)
                    {
                        string targetPath = JTweenUtils.GetTranPath(tween.Target);
                        if (!targetPath.StartsWith(curPath))
                        {
                            Debug.LogErrorFormat("JTweenSequence DoJson target is not child! Path:{0}", targetPath);
                            continue;
                        } // end if
                        node["_PATH"] = JTweenUtils.GetTranPath(tween.Target).Replace(curPath, "");
                    }     // end if
                    json.Add(node);
                }
            }
            return(json);
        }