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); }); } }
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); }
protected override void Update(GameTime gameTime) { double elapsed = gameTime.ElapsedGameTime.TotalSeconds; TimerCollection.GetInstance().Update(elapsed); InterpolatorCollection.GetInstance().Update(elapsed); input.Update(); screenmanager.Update(elapsed); }
public void Delay(float delayTime, Action callBack) { TimerCollection.Callback delayFunc = () => { callBack(); }; Timer _timer = TimerCollection.GetInstance().Create(delayFunc, true, null); _timer.Start(delayTime); }
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); } }
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)); } }
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); }); }
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); } }); }
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; } }
protected void DoResumeScene() { Timer _timer = TimerCollection.GetInstance().Create(StartResumeFuncMethod, true, null); _timer.Start(0.5f); }
protected override void Beat() { TimerCollection.GetInstance().Update(); }
private void DelayedRemoved(Screen screen) { Timer t = TimerCollection.GetInstance().Create(screen.transition_time, false, Remove); t.tag = screen; }
public Timer(TimerCollection.Callback _func, TimerCollection.CallbackWithTime _funcWithTime) { func = _func; funcWithTime = _funcWithTime; autoRelease = false; }
public DynamicPanel(GuiManager manager, Rect rect) : base(manager, rect) { _timers = new TimerCollection(); _interpolators = new InterpolatorCollection(); }
public Timer(TimerCollection.Callback _func, bool autoR, TimerCollection.CallbackWithTime _funcWithTime) { func = _func; funcWithTime = _funcWithTime; autoRelease = autoR; }
private void DelayedSetReady() { TimerCollection.GetInstance().Create(transition_time, false, SetReady); }
public virtual bool CanResetAllTimers() { return((TimerCollection.Count > 0) && (TimerCollection.Any(t => t.Timer > TimeSpan.Zero))); }
protected void AddTimer(ActivityTimerVM timerVm) { timerVm.DeleteRequested += DeleteTimer; (timerVm as System.ComponentModel.INotifyPropertyChanged).PropertyChanged += TimerVM_PropertyChanged; TimerCollection.Add(timerVm); }