Exemple #1
0
 public override void Do()
 {
     TimedTask.createTask((timer) =>
     {
         if (mSpeed > 0)
         {
             if (mActorImage.Opacity >= mEnd)
             {
                 mActorImage.Opacity = mEnd;
                 timer.Stop();
                 OnFinish();
             }
         }
         else if (mSpeed < 0)
         {
             if (mActorImage.Opacity <= mEnd)
             {
                 mActorImage.Opacity = mEnd;
                 timer.Stop();
                 OnFinish();
             }
         }
         mActorImage.Opacity += mSpeed;
     }, 0.01, true).Start();
 }
Exemple #2
0
        public GameEventDelay(Action doWhat, double delay)
        {
            mDoWhat = (t) => doWhat();
            mDelay  = delay;

            mTimedTask = TimedTask.createTask(mDoWhat, mDelay);
        }