Esempio n. 1
0
    private void UpdateFps(FpsType fpsType)
    {
        var type = (int) fpsType;
        float timeNow = Time.realtimeSinceStartup;
        ++_frames[type];
        if (timeNow > _lastInterval[type] + updateInterval)
        {
            _fps[type] = (float)(_frames[type] / (timeNow - _lastInterval[type]));
            _frames[type] = 0;
            _lastInterval[type] = timeNow;

            if (_fpsTexts[type])
                _fpsTexts[type].text = _updateTypeTexts[type] + _fps[0].ToString("f2");
        }
    }
Esempio n. 2
0
File: Alpha.cs Progetto: yooyke/work
        /// <summary>
        /// AlphaController's custome constructor
        /// </summary>
        /// <param name="start">Start alpha value</param>
        /// <param name="end">Target alpha value</param>
        /// <param name="speed">Increment value speed</param>
        /// <param name="fps">Timer update frame per second</param>
        public Alpha(float start, float end, float speed, FpsType fps)
        {
            Set(start, end, speed);

            this.fps = fps;
        }