Update() public method

public Update ( float elapsedTimeInSeconds ) : void
elapsedTimeInSeconds float
return void
        protected override void OnUpdate()
        {
            base.OnUpdate();

            animatedSkeleton.Update(this.FrameDelta);
        }
Exemplo n.º 2
0
        protected override void OnKeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            base.OnKeyUp(sender, e);

            int idx = -1;

            switch (e.KeyCode)
            {
            case System.Windows.Forms.Keys.D1: idx = 0; break;

            case System.Windows.Forms.Keys.D2: idx = 1; break;

            case System.Windows.Forms.Keys.D3: idx = 2; break;

            case System.Windows.Forms.Keys.D4: idx = 3; break;

            case System.Windows.Forms.Keys.D5: idx = 4; break;

            case System.Windows.Forms.Keys.D6: idx = 5; break;

            case System.Windows.Forms.Keys.X:
            {
                skeleton.Enabled = !skeleton.Enabled;
                return;
            }

            case System.Windows.Forms.Keys.P:
            {
                this.globalSettings.RenderPgrps = !this.globalSettings.RenderPgrps;
                return;
            }

            case System.Windows.Forms.Keys.Right:
            {
                if (isPaused)
                {
                    currentSkeletonFrame.Update(timeStep);
                }
                return;
            }

            case System.Windows.Forms.Keys.Left:
            {
                if (isPaused)
                {
                    currentSkeletonFrame.Update(-timeStep);
                }
                return;
            }

            case System.Windows.Forms.Keys.Space:
            {
                isPaused = !isPaused;
                return;
            }
            }

            if (idx < 0)
            {
                return;
            }
            if (this.textures[idx] == null)
            {
                return;
            }

            int newTexIdx = this.textureIndices[idx];

            if (e.Shift)
            {
                this.models[idx].Enabled = !this.models[idx].Enabled;
            }
            else
            {
                if (!this.models[idx].Enabled)
                {
                    return;
                }
                if (this.textures[idx].Count <= 1)
                {
                    return;
                }

                newTexIdx = (newTexIdx + 1) % this.textures[idx].Count;
                this.textureIndices[idx] = newTexIdx;

                this.globalSettings.TextureManager.AddRange(this.textures[idx][newTexIdx]);
            }

            if (this.models[idx].Enabled)
            {
                this.textureUI[idx].Label = string.Format("[{3}] {0} - {1}/{2}", (ModelPart)idx, newTexIdx + 1, this.textures[idx].Count, idx + 1);
            }
            else
            {
                this.textureUI[idx].Label = string.Format("[{1}] {0} - Hidden", (ModelPart)idx, idx + 1);
            }
        }