コード例 #1
0
        public void update(InputState input)
        {
            if (input.isActive(InputState.Control.EXIT)) {
                this.exit = true;
                return;
            }
            if (null == this.runningTime)
                this.runningTime = Stopwatch.StartNew();

            long deltaT = this.runningTime.ElapsedMilliseconds;
            if (deltaT > this.fadeInTime + this.fadeOutTime) {
                this.fadeAmount = 0.0f;
            } else if (deltaT > this.fadeInTime) {
                this.fadeAmount = 1.0f - (float) (deltaT - fadeInTime) / (float) fadeOutTime;
            } else {
                this.fadeAmount = (float)deltaT / (float)fadeInTime;
            }
        }
コード例 #2
0
        private bool hasExitState(InputState input)
        {
            if (this.exit) {
                return true;
            }

            if (this.song.stoppedPlaying() ||
                    input.isActive(InputState.Control.EXIT)) {
                exit = true;
                return true;
            }

            return false;
        }