コード例 #1
0
        public void Hurt()
        {
            if (curr_size > 0 || num_collected > 0)
            {
                hurt          = 5;
                num_collected = 0;

                hurt_logic.Burst();
                ParticleManager.GetInstance().Explode(position, 10);
                hurt_logic.Burst();

                DecreaseSize();
                Resources.droplet_sound.Play(0.025f, ((float)rand.NextDouble() - 0.5f), 0);
            }
            else
            {
                pop_logic.Burst();
                player.velocity = Vector3.Zero;
                player.removed  = true;
                popped          = true;
                hurt            = 5;
                Resources.droplet_sound.Play(0.025f, ((float)rand.NextDouble() - 0.5f), 0);

                TimerCollection.GetInstance().Create(5, false, (t) => { hurt = 5; popped = false; player.removed = false; SetPosition(new Vector2(0, 0)); body.Update(0); });
            }
        }
コード例 #2
0
    protected void DoEnterScene()
    {
        //HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());
        //FuncMethods.HandleFuncExec(target, m_CurrentStage.EnterFuncId, null);
        Timer _timer = TimerCollection.GetInstance().Create(StartFuncMethod, true, null);

        _timer.Start(0.5f);
    }
コード例 #3
0
        protected override void Update(GameTime gameTime)
        {
            double elapsed = gameTime.ElapsedGameTime.TotalSeconds;

            TimerCollection.GetInstance().Update(elapsed);
            InterpolatorCollection.GetInstance().Update(elapsed);

            input.Update();
            screenmanager.Update(elapsed);
        }
コード例 #4
0
    public void Delay(float delayTime, Action callBack)
    {
        TimerCollection.Callback delayFunc = () =>
        {
            callBack();
        };
        Timer _timer = TimerCollection.GetInstance().Create(delayFunc, true, null);

        _timer.Start(delayTime);
    }
コード例 #5
0
 protected void OnPressFun(bool _isPress)
 {
     isPressed = _isPress;
     if (!isPressed && pressAction != null)
     {
         pressAction(_isPress);
     }
     if (isPressed && pressAction != null)
     {
         Timer _timer = TimerCollection.GetInstance().Create(PressTimerFun, true, null);
         _timer.Start(pressAndHoldDelay);
     }
 }
コード例 #6
0
ファイル: Timer.cs プロジェクト: dekkerb115/Bam.Net
 public ActionResult Save(Bam.Net.Analytics.Timer[] values)
 {
     try
     {
         TimerCollection saver = new TimerCollection();
         saver.AddRange(values);
         saver.Save();
         return(Json(new { Success = true, Message = "", Dao = "" }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
コード例 #7
0
        public void Birth()
        {
            hurt           = 10;
            player.removed = true;
            num_collected  = 0;

            TimerCollection.GetInstance().Create(5, false, (t) => {
                player.removed  = false;
                player.velocity = Vector3.Zero;
                velocity        = Vector3.Zero;
                final_pop.Burst();
                SetSize(0);
                body.Update(0);
                Resources.droplet_sound.Play(0.025f, ((float)rand.NextDouble() - 0.5f), 0);
            });
        }
コード例 #8
0
 public void PlayAudio(string name, Action callBack, float delayTime = 0.5f)
 {
     name = "GUIDE/MessageTree/" + name;
     AudioPlayer.Instance.PlayAudio(name, Vector3.zero, false, (res) =>
     {
         if (delayTime <= 0.0f)
         {
             callBack();
         }
         else
         {
             TimerCollection.Callback delayFunc = () =>
             {
                 callBack();
             };
             Timer _timer = TimerCollection.GetInstance().Create(delayFunc, true, null);
             _timer.Start(delayTime);
         }
     });
 }
コード例 #9
0
 public void Start()
 {
     TimerDI = new TimerCollection(); //创建容器
     try {
         BootStrap boot = new BootStrap();
         TimerDI = boot.Boot();
         foreach (string key in TimerDI.Timers.Keys) {
             TimerDI.Timers[key].Start();
         }
         if (_OnSuccess != null)
             _OnSuccess();
     }
     catch (Exception ex) {
         Dispose();
         if (_OnFail != null)
             _OnFail(ex);
         else
             throw ex;
     }
 }
コード例 #10
0
    protected void DoResumeScene()
    {
        Timer _timer = TimerCollection.GetInstance().Create(StartResumeFuncMethod, true, null);

        _timer.Start(0.5f);
    }
コード例 #11
0
 protected override void Beat()
 {
     TimerCollection.GetInstance().Update();
 }
コード例 #12
0
 private void DelayedRemoved(Screen screen)
 {
     Timer t = TimerCollection.GetInstance().Create(screen.transition_time, false, Remove); t.tag = screen;
 }
コード例 #13
0
ファイル: Timer.cs プロジェクト: Blizzardx/ClientFrameWork
    public Timer(TimerCollection.Callback _func, TimerCollection.CallbackWithTime _funcWithTime)
    {
		func = _func;
        funcWithTime = _funcWithTime;
        autoRelease = false;
	}
コード例 #14
0
 public DynamicPanel(GuiManager manager, Rect rect) : base(manager, rect)
 {
     _timers        = new TimerCollection();
     _interpolators = new InterpolatorCollection();
 }
コード例 #15
0
ファイル: Timer.cs プロジェクト: Blizzardx/ClientFrameWork
 public Timer(TimerCollection.Callback _func, bool autoR, TimerCollection.CallbackWithTime _funcWithTime)
 {
     func = _func;
     funcWithTime = _funcWithTime;
     autoRelease = autoR;
 }
コード例 #16
0
ファイル: screen.cs プロジェクト: imclab/bubblebound
 private void DelayedSetReady()
 {
     TimerCollection.GetInstance().Create(transition_time, false, SetReady);
 }
コード例 #17
0
 public virtual bool CanResetAllTimers()
 {
     return((TimerCollection.Count > 0) &&
            (TimerCollection.Any(t => t.Timer > TimeSpan.Zero)));
 }
コード例 #18
0
 protected void AddTimer(ActivityTimerVM timerVm)
 {
     timerVm.DeleteRequested += DeleteTimer;
     (timerVm as System.ComponentModel.INotifyPropertyChanged).PropertyChanged += TimerVM_PropertyChanged;
     TimerCollection.Add(timerVm);
 }