CEngineSharp_Editor.NpcEditor.NpcAnimationLogic C# (CSharp) Method

NpcAnimationLogic() private method

private NpcAnimationLogic ( ) : void
return void
        private void NpcAnimationLogic()
        {
            this.npcSpriteDisplay.SetFramerateLimit(8);
            this.npcSpriteDisplay.SetActive(true);

            while (!this.exiting)
            {
                this.npcSpriteDisplay.Clear();

                var oldRect = this.npcSprite.TextureRect;
                var newRect = new IntRect();
                newRect.Width = 32;
                newRect.Height = 32;

                if (oldRect.Left >= 64)
                {
                    newRect.Left = 0;

                    if (oldRect.Top >= 96)
                    {
                        newRect.Top = 0;
                    }
                    else
                    {
                        newRect.Top = oldRect.Top + 32;
                    }
                }
                else
                {
                    newRect.Left = oldRect.Left + 32;
                    newRect.Top = oldRect.Top;
                }

                this.npcSprite.TextureRect = newRect;

                this.npcSpriteDisplay.Draw(this.npcSprite);

                this.npcSpriteDisplay.Display();
            }
        }