예제 #1
0
        void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            Thread.Sleep(2000);

            opacDel = delegate()
            {
                this.ShowInTaskbar = true;
            };

            try
            {
                this.Invoke(opacDel);
            }
            catch { }

            Thread.Sleep(1000);

            opacDel = delegate()
            {
                this.Opacity   = 100;
                Cursor.Current = Cursors.Default;
                splashThread.Abort();
            };

            try
            {
                this.Invoke(opacDel);
            }
            catch { }
        }
예제 #2
0
파일: Fade.cs 프로젝트: GlintGame/Glint
        public static IEnumerator DoFadeOpacity(OpacityDelegate opacityDelegate, float fromOpacity, float toOpacity, float fadeDuration)
        {
            float currentTime = 0f;

            while (currentTime <= fadeDuration)
            {
                float timeProportion = currentTime / fadeDuration;

                opacityDelegate(fromOpacity + (toOpacity - fromOpacity) * timeProportion);

                currentTime += Time.timeScale == 0f ? Time.fixedUnscaledDeltaTime : Time.fixedDeltaTime;

                yield return(null);
            }

            opacityDelegate(toOpacity);
        }
        void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            Thread.Sleep(2000);

            opacDel = delegate()
            {
                this.ShowInTaskbar = true;
            };

            try
            {
                this.Invoke(opacDel);
            }
            catch { }

            Thread.Sleep(1000);

            opacDel = delegate()
            { 
              this.Opacity = 100;
              Cursor.Current = Cursors.Default;
              splashThread.Abort();                
            };

            try
            {
                this.Invoke(opacDel);
            }
            catch { }
        }