private void AddMultipleFrameAnimation(string p_animName, TilesetManager.ProjectileTileSet p_tile, int p_frameCount, float p_frameDuration = 0.2f)
 {
     AnimationsList.Add(new Animation(p_animName));
     for (int i = 0; i < p_frameCount; i++)
     {
         AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile + i, p_frameDuration));
     }
 }
Exemplo n.º 2
0
        public void Prepare()
        {
            scenes[0].Prepare();

            // Do not export empty arrays
            if (NodesList.Count > 0)
            {
                nodes = NodesList.ToArray();
                NodesList.ForEach(node => node.Prepare());
            }
            if (CamerasList.Count > 0)
            {
                cameras = CamerasList.ToArray();
            }
            if (BuffersList.Count > 0)
            {
                buffers = BuffersList.ToArray();
            }
            if (BufferViewsList.Count > 0)
            {
                bufferViews = BufferViewsList.ToArray();
            }
            if (AccessorsList.Count > 0)
            {
                accessors = AccessorsList.ToArray();
            }
            if (MeshesList.Count > 0)
            {
                meshes = MeshesList.ToArray();
            }
            if (MaterialsList.Count > 0)
            {
                materials = MaterialsList.ToArray();
            }
            if (TexturesList.Count > 0)
            {
                textures = TexturesList.ToArray();
            }
            if (ImagesList.Count > 0)
            {
                images = ImagesList.ToArray();
            }
            if (SamplersList.Count > 0)
            {
                samplers = SamplersList.ToArray();
            }
            if (AnimationsList.Count > 0)
            {
                animations = AnimationsList.ToArray();
                AnimationsList.ForEach(animation => animation.Prepare());
            }
            if (SkinsList.Count > 0)
            {
                skins = SkinsList.ToArray();
            }
        }
 private void AddAllDirectionAnimation(TilesetManager.ProjectileTileSet p_tile, float p_frameDuration = 0.2f)
 {
     AnimationsList.Add(new Animation("Right"));
     AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile, p_frameDuration));
     AnimationsList.Add(new Animation("Up"));
     AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile + 1, p_frameDuration));
     AnimationsList.Add(new Animation("Left"));
     AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile + 2, p_frameDuration));
     AnimationsList.Add(new Animation("Down"));
     AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile + 3, p_frameDuration));
 }
 private void BtnImport_Click(object sender, EventArgs e)
 {
     RenderBase.OAnimationListBase animation = (RenderBase.OAnimationListBase)FileIO.import(type);
     if (animation != null)
     {
         animations.list.AddRange(animation.list);
         foreach (RenderBase.OAnimationBase anim in animation.list)
         {
             AnimationsList.addItem(anim.name);
         }
         AnimationsList.Refresh();
     }
 }
        private void updateList()
        {
            AnimationsList.flush();
            if (control != null)
            {
                control.load(-1);

                foreach (RenderBase.OAnimationBase animation in animations.list)
                {
                    AnimationsList.addItem(animation.name);
                }
            }
            AnimationsList.Refresh();
        }
Exemplo n.º 6
0
        private void BtnImport_Click(object sender, EventArgs e)
        {
            var animation = FileExport.ImportAnimation <T>();

            if (animation != null)
            {
                animations.AddRange(animation);
                foreach (RenderBase.OAnimationBase anim in animation)
                {
                    AnimationsList.addItem(anim.name);
                }
                AnimationsList.Refresh();
            }
        }
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (AnimationsList.SelectedIndex == -1)
     {
         return;
     }
     animations.list.RemoveAt(AnimationsList.SelectedIndex);
     AnimationsList.removeItem(AnimationsList.SelectedIndex);
     if (animations.list.Count == 0)
     {
         control.stop();
         isAnimationLoaded  = false;
         BtnPlayPause.Image = Properties.Resources.ui_icon_play;
         paused             = true;
     }
 }
Exemplo n.º 8
0
        public void Prepare()
        {
            scenes[0].Prepare();

            // Do not export empty arrays
            if (NodesList.Count > 0)
            {
                nodes = NodesList.ToArray();
                NodesList.ForEach(node => node.Prepare());
            }
            if (CamerasList.Count > 0)
            {
                cameras = CamerasList.ToArray();
            }
            if (BuffersList.Count > 0)
            {
                buffers = BuffersList.ToArray();
            }
            if (BufferViewsList.Count > 0)
            {
                bufferViews = BufferViewsList.ToArray();
            }
            if (AccessorsList.Count > 0)
            {
                accessors = AccessorsList.ToArray();
            }
            if (MeshesList.Count > 0)
            {
                meshes = MeshesList.ToArray();
            }
            if (MaterialsList.Count > 0)
            {
                materials = MaterialsList.ToArray();
            }
            if (TexturesList.Count > 0)
            {
                textures = TexturesList.ToArray();
            }
            if (ImagesList.Count > 0)
            {
                images = ImagesList.ToArray();
            }
            if (SamplersList.Count > 0)
            {
                samplers = SamplersList.ToArray();
            }
            if (AnimationsList.Count > 0)
            {
                var animationsList = new List <GLTFAnimation>();
                AnimationsList.ForEach(animation =>
                {
                    animation.Prepare();
                    // Exclude empty animations
                    if (animation.channels != null)
                    {
                        animationsList.Add(animation);
                    }
                });
                if (animationsList.Count > 0)
                {
                    animations = animationsList.ToArray();
                }
            }
            if (SkinsList.Count > 0)
            {
                skins = SkinsList.ToArray();
            }
            if (extensionsUsed != null && extensionsUsed.Count == 0)
            {
                extensionsUsed = null;
            }
            if (extensionsRequired != null && extensionsRequired.Count == 0)
            {
                extensionsRequired = null;
            }
        }
Exemplo n.º 9
0
 public void finalize()
 {
     AnimationsList.flush();
 }
Exemplo n.º 10
0
 private void AddTwoFrameAnimation(string p_animName, TilesetManager.PlayerTileSet p_tile, float p_frameDuration = 0.2f)
 {
     AnimationsList.Add(new Animation(p_animName));
     AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile, p_frameDuration));
     AnimationsList[AnimationsList.Count - 1].FramesList.Add(new AnimationFrame(p_tile + 1, p_frameDuration));
 }