Exemplo n.º 1
0
 public void AddAvatarActionDirectionAnimation(ImageAnimation animation)
 {
     if (animation != null)
     {
         directionAnimations.Add(animation);
     }
 }
Exemplo n.º 2
0
 private IEnumerator LoadSprites(ImageAnimation imgAnimation)
 {
     foreach (string img in imgAnimation.frameImages)
     {
         yield return(LoadSprite(img));
     }
     finishLoading = true;
 }
Exemplo n.º 3
0
 public void InitSprites(ImageAnimation imgAnimation)
 {
     if (!hasInit)
     {
         hasInit = true;
         AssetManager.Instance.StartCoroutine(LoadSprites(imgAnimation));
     }
 }
Exemplo n.º 4
0
        private static ImageAnimation ParseAnimation(XmlElement node)
        {
            ImageAnimation ia   = new ImageAnimation();
            string         path = node.GetAttribute("path");
            XmlNodeList    list = node.GetElementsByTagName("img");

            foreach (XmlElement element in list)
            {
                string name = element.GetAttribute("name");
                ia.AddFrameImage(path + name);
            }
            return(ia);
        }
Exemplo n.º 5
0
        private static AvatarActionImageAnimation ParseAvatarAction(XmlElement node)
        {
            string actionName = node.GetAttribute("name");
            AvatarActionImageAnimation animationList = new AvatarActionImageAnimation(actionName);
            XmlNodeList list = node.GetElementsByTagName("animation");

            foreach (XmlElement animationNode in list)
            {
                ImageAnimation ia = ParseAnimation(animationNode);
                animationList.AddAvatarActionDirectionAnimation(ia);
            }
            return(animationList);
        }