Ejemplo n.º 1
0
        void PlayAnim()
        {
            animSprite.NextFrame();
            //Console.WriteLine($"Startframe: {startFrame} Currentframe: {animSprite.currentFrame}");
            //Console.WriteLine($"if currentFrame {animSprite.currentFrame} > {startFrame + 3}");
            if (animSprite.currentFrame > startFrame + 3)
            {
                animSprite.SetFrame(startFrame);
            }

            if (animSprite.currentFrame == 0 && startFrame == 12) //special case for frame '16' which doesnt exist and becomes 0 -Jesse
            {
                animSprite.SetFrame(startFrame);
            }
        }
Ejemplo n.º 2
0
        public void Update()
        {
            _active = false;
            if (bar.frameCount > bar.currentFrame + 1)
            {
                bar.NextFrame();
            }

            if (Input.GetKeyDown(thisKey) && bar.currentFrame >= 5)
            {
                click();
            }
            if (Input.GetKeyDown(thisArrowKey) && bar.currentFrame >= 5)
            {
                click();                                                                      //For the arrow keys. These are used by the arduino converter
            }
        }