Ejemplo n.º 1
0
        private void Parse(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
        {
            Referenced = GetTimelineKey(element, animation);

            int parentId = element.GetInt("parent", -1);

            if (parentId >= 0)
            {
                Parent = parentKey.GetBoneRef(parentId);
            }
        }
Ejemplo n.º 2
0
        protected virtual void Parse(XmlElement element, SpriterAnimation animation)
		{
			Animation = animation;
            Name = element.GetString("name", "");

            ObjectType = ObjectType.Parse(element);

            var children = element.GetElementsByTagName(TimelineKey.XmlKey);
            foreach (XmlElement childElement in children)
            {
                keys.Add(GetKey(childElement));
            }
        }
Ejemplo n.º 3
0
        protected virtual void Parse(XmlElement element, SpriterAnimation animation)
        {
            Animation = animation;
            Name      = element.GetString("name", "");

            ObjectType = ObjectType.Parse(element);

            var children = element.GetElementsByTagName(TimelineKey.XmlKey);

            foreach (XmlElement childElement in children)
            {
                keys.Add(GetKey(childElement));
            }
        }
Ejemplo n.º 4
0
        protected TimelineKey GetTimelineKey(XmlElement element, SpriterAnimation animation)
        {
            int timeline = element.GetInt("timeline", 0);
            int key      = element.GetInt("key", 0);

            var timelineObj = animation.GetTimeline(timeline);

            if (timelineObj == null)
            {
                Debug.LogError(String.Format(
                                   System.Globalization.CultureInfo.InvariantCulture,
                                   "Unable to find timeline {0} in animation {1}",
                                   timeline,
                                   animation.Id));
            }
            return(timelineObj.GetKey(key));
        }
Ejemplo n.º 5
0
 protected virtual void Parse(XmlElement element, SpriterAnimation animation)
 {
     //Get elements
     //TODO: Ensure proper ordering of elements to prevent dependency errors
     var children = element.ChildNodes;
     foreach(XmlNode child in children)
     {
         XmlElement childElement = child as XmlElement;
         if(childElement != null)
         {
             switch(childElement.Name)
             {
                 case BoneRef.XmlKey:
                     refs.Add(new BoneRef(childElement, animation, this));
                     break;
                 case ObjectRef.XmlKey:
                     refs.Add(new ObjectRef(childElement, animation, this));
                     break;
             }
         }
     }
 }
Ejemplo n.º 6
0
        protected virtual void Parse(XmlElement element, SpriterAnimation animation)
        {
            //Get elements
            //TODO: Ensure proper ordering of elements to prevent dependency errors
            var children = element.ChildNodes;

            foreach (XmlNode child in children)
            {
                XmlElement childElement = child as XmlElement;
                if (childElement != null)
                {
                    switch (childElement.Name)
                    {
                    case BoneRef.XmlKey:
                        refs.Add(new BoneRef(childElement, animation, this));
                        break;

                    case ObjectRef.XmlKey:
                        refs.Add(new ObjectRef(childElement, animation, this));
                        break;
                    }
                }
            }
        }
Ejemplo n.º 7
0
 public ObjectRef(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element, animation, parentKey)
 {
 }
Ejemplo n.º 8
0
 public Ref(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element)
 {
     MainlineKey = parentKey;
     Parse(element, animation, parentKey);
 }
Ejemplo n.º 9
0
        private void Parse(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
        {
            Referenced = GetTimelineKey(element, animation);

            int parentId = element.GetInt("parent", -1);
            if(parentId >= 0)
            {
                Parent = parentKey.GetBoneRef(parentId);
            }
        }
Ejemplo n.º 10
0
        protected TimelineKey GetTimelineKey(XmlElement element, SpriterAnimation animation)
        {
            int timeline = element.GetInt("timeline", 0);
            int key = element.GetInt("key", 0);

            var timelineObj = animation.GetTimeline(timeline);
            if (timelineObj == null)
            {
                Debug.LogError(String.Format(
                    System.Globalization.CultureInfo.InvariantCulture,
                    "Unable to find timeline {0} in animation {1}",
                    timeline,
                    animation.Id));
            }
            return timelineObj.GetKey(key);
        }
Ejemplo n.º 11
0
 public MainlineKey(XmlElement element, SpriterAnimation animation)
     : base(element)
 {
     Parse(element, animation);
 }
Ejemplo n.º 12
0
 private void MakePrefab(Animation animation, GameObject root, string spriteFolder)
 {
     foreach(var mainKey in animation.MainlineKeys)
     {
         MakePrefab(mainKey, root, spriteFolder);
     }
 }
Ejemplo n.º 13
0
 private void MakePrefab(Animation animation, GameObject root)
 {
     foreach(var mainKey in animation.MainlineKeys)
     {
         MakePrefab(mainKey, root);
     }
 }
Ejemplo n.º 14
0
 public Ref(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element)
 {
     MainlineKey = parentKey;
     Parse(element, animation, parentKey);
 }
Ejemplo n.º 15
0
 public Timeline(XmlElement element, SpriterAnimation animation)
     : base(element)
 {
     Parse(element, animation);
 }
Ejemplo n.º 16
0
        public Timeline(XmlElement element, SpriterAnimation animation)
            :base(element)
        {		
			Parse (element, animation);
		}
Ejemplo n.º 17
0
 public ObjectRef(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element, animation, parentKey)
 {
 }
Ejemplo n.º 18
0
 public MainlineKey(XmlElement element, SpriterAnimation animation)
     : base(element)
 {
     Parse(element, animation);
 }