コード例 #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);
            }
        }
コード例 #2
0
ファイル: PrefabBuilder.cs プロジェクト: dval/Spriter2Unity
 private void MakePrefab(MainlineKey mainKey, GameObject root, string spriteFolder)
 {
     var rootInfo = mainKey.GetChildren(null).Select(child => new RefParentInfo { Ref = child, Root = root });
     Stack<RefParentInfo> toProcess = new Stack<RefParentInfo>(rootInfo);
     while(toProcess.Count > 0)
     {
         var next = toProcess.Pop();
         var go = MakePrefab(next.Ref, next.Root, spriteFolder);
         foreach(var child in mainKey.GetChildren(next.Ref))
         {
             toProcess.Push(new RefParentInfo{Ref = child, Root = go});
         }
     }
 }
コード例 #3
0
 public ObjectRef(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element, animation, parentKey)
 {
 }
コード例 #4
0
ファイル: Ref.cs プロジェクト: ViktorFagerlind/PlatformRpg
 public Ref(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element)
 {
     MainlineKey = parentKey;
     Parse(element, animation, parentKey);
 }
コード例 #5
0
ファイル: Ref.cs プロジェクト: ViktorFagerlind/PlatformRpg
        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);
            }
        }
コード例 #6
0
ファイル: Ref.cs プロジェクト: pjwaixingren/Spriter2Unity
 public Ref(XmlElement element, Animation animation, MainlineKey parentKey)
     : base(element)
 {
     Parse(element, animation, parentKey);
 }
コード例 #7
0
ファイル: ObjectRef.cs プロジェクト: swipswaps/Spriter2Unity
 public ObjectRef(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element, animation, parentKey)
 {
 }
コード例 #8
0
        private void SetGameObjectForKey(GameObject root, AnimationClip animClip, MainlineKey mainlineKey)
        {
            //Could do this recursively - this is easier
            Stack<Ref> toProcess = new Stack<Ref>(mainlineKey.GetChildren(null));

            while(toProcess.Count > 0)
            {
                var next = toProcess.Pop();

                SetGameObjectForRef(root, next);
                SetSpriteEvent(animClip, mainlineKey.Time, next);

                var children = mainlineKey.GetChildren(next);
                foreach (var child in children) toProcess.Push(child);
            }
        }
コード例 #9
0
 public Ref(XmlElement element, SpriterAnimation animation, MainlineKey parentKey)
     : base(element)
 {
     MainlineKey = parentKey;
     Parse(element, animation, parentKey);
 }
コード例 #10
0
        private HashSet<string> SetGameObjectForKey(GameObject root, AnimationClip animClip, MainlineKey mainlineKey, float time = -1)
        {
            HashSet<string> paths = new HashSet<string>();
            //Could do this recursively - this is easier
            Stack<Ref> toProcess = new Stack<Ref>(mainlineKey.GetChildren(null));

            while (toProcess.Count > 0)
            {
                var next = toProcess.Pop();

                paths.Add(next.RelativePath);
                SetGameObjectForRef(root, next, time);
                SetSpriteEvent(animClip, time, next);

                var children = mainlineKey.GetChildren(next);
                foreach (var child in children) toProcess.Push(child);
            }

            return paths;
        }
コード例 #11
0
ファイル: BoneRef.cs プロジェクト: pjwaixingren/Spriter2Unity
 public BoneRef(XmlElement element, Animation animation, MainlineKey parentKey)
     : base(element, animation, parentKey)
 {
 }