void OnNewWeightGoal(IEventArgs eventArgs) { NewTargetWeightEventArgs targetWeightArgs = (NewTargetWeightEventArgs)eventArgs; goalWeight = targetWeightArgs.GoalWeight; maxWeight = targetWeightArgs.MaxWeight; UpdateWeight(); }
void OnAccelerometer(IEventArgs eventArgs) { AccelerometerEventArgs accelEvents = (AccelerometerEventArgs)eventArgs; AccelXLabelText.text = "Accelerometer X: " + accelEvents.Accelerometer.x; AccelYLabelText.text = "Accelerometer Y: " + accelEvents.Accelerometer.y; AccelZLabelText.text = "Accelerometer Z: " + accelEvents.Accelerometer.z; }
void OnWeightChange(IEventArgs args) { WeightChangeEventArgs weightChangeArgs = (WeightChangeEventArgs)args; CurrentWeight += weightChangeArgs.ChangeAmount; if (CurrentWeight <= 0f) { //Probably fire an event here? CurrentWeight = 0f; } eventManager.FireEvent(NewWeight, new NewWeightEventArgs(CurrentWeight)); }
public void FireEvent(string eventName, IEventArgs args) { if (_managedEvents.ContainsKey(eventName)) { foreach (TriggeredEvent trigger in _managedEvents[eventName]) { trigger.Invoke(args); } } else { Debug.LogWarning ("Attempting to fire an event that is not registered: " + eventName); } }
public void OnNewWeight(IEventArgs args) { if (currentLevel == null) return; NewWeightEventArgs newWeightArgs = (NewWeightEventArgs)args; if (newWeightArgs.NewWeight <= currentLevel.WeightGoal) { //Beat the level! //TODO: do more than this TransitionToNextLevel(); } else if (newWeightArgs.NewWeight >= currentLevel.WeightMax) { //Lost the level! ServiceManager.Instance.GetService<StatsManager>(ServiceType.StatsManager).SetWeight(2000f); //TODO: do more than this TransitionToLevel(1); } }
private void OnSceneLoadedCallbak(object sender, IEventArgs e) { SceneLoadedEventArgs ne = (SceneLoadedEventArgs)e; Debug.Log("OnSceneLoadedCallbak:" + ne.SceneName); }
protected override DelayedTask CreatNew(IEventArgs arg) { return(new DelayedTask()); }
protected override bool OnSet(DelayedTask t, IEventArgs arg) { t.action = null; return(base.OnSet(t, arg)); }
/// <summary> /// 回收,当数量超过回收失败 /// </summary> /// <param name="t"></param> /// <param name="arg"></param> /// <returns></returns> protected override bool OnSet(T t, IEventArgs arg) { base.OnSet(t, arg); return(count <= capcity); }
public override int GetKey(IEventArgs args) { return(EXP); }
public static void Set <T>(T t, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject { Set(typeof(T), t, owner, arg); }
public static void Clear <T>(IEventArgs arg, bool ignoreRun = true) { Clear(typeof(T), arg, ignoreRun); }
public override IList <IFreeUIAuto> GetAutos(IEventArgs args) { return(autos); }
public override string GetXyz(IEventArgs args, IPosSelector selector) { return(FreeUtil.ReplaceVar(xyz, args)); }
public override string GetStyle(IEventArgs args) { return(FreeUtil.ReplaceVar(url, args) + "_$$$_" + center + "_$$$_" + FreeUtil.ReplaceVar(originalSize, args) + "_$$$_" + FreeUtil.ReplaceVar(coverUrl, args) + "_$$$_" + FreeUtil.ReplaceVar(@fixed, args) + "_$$$_" + FreeUtil.ReplaceVar(noMouse , args) + "_$$$_" + FreeUtil.ReplaceVar(useMask, args) + "_$$$_" + FreeUtil.ReplaceVar(isMask, args) + "_$$$_" + FreeUtil.ReplaceVar(mirror, args)); }
public override int GetKey(IEventArgs args) { return(IMAGE); }
private void OnHttpResponseFail(object sender, IEventArgs e) { HttpResponseFailEventArgs ne = (HttpResponseFailEventArgs)e; Debug.Log("OnHttpReadTextFailEventArgs:url:" + ne.Url + ",error:" + ne.Error); }
private void OnHttpResponseSuccess(object sender, IEventArgs e) { HttpResponseSuccessEventArgs ne = (HttpResponseSuccessEventArgs)e; Debug.Log("OnHttpReadTextSuccess:url:" + ne.Url + ",content:" + ne.Content); }
private void OnTestEventCallback(object sender, IEventArgs e) { TestEventArgs ne = (TestEventArgs)e; Debug.Log("OnTestEventCallback:" + ne.Parameters); }
public static void Set(IPoolObject[] objs, IEventArgs arg) { objs.ForEach((o) => { Set(o, arg); }); }
public override string GetRotation(IEventArgs args, IPosSelector selector) { return(FreeUtil.ReplaceVar(rotation, args)); }
public static void Set <T>(T obj, IEventArgs arg) where T : IPoolObject { Set(typeof(T), obj, arg); }
/// <summary> /// 发布消息 /// </summary> /// <param name="message"></param> protected void Publish(IEventArgs message) { (context as IViewModel).Listen(message); }
public static void Set <T>(T[] objs, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject { objs.ForEach((o) => { Set(typeof(T), o, owner, arg); }); }
public static T Get <T>(IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject { return((T)Get(typeof(T), owner, arg)); }
public static void Clear(IPoolObject[] objs, IEventArgs arg, bool ignoreRun = true) { objs.ForEach((o) => { Clear(o, arg, ignoreRun); }); }
public static void AutoPutBomb(IEventArgs args, FreeData fd, ItemPosition item) { }
public void AddHp(IEventArgs args) { AddHp((args as EventArgsInt).X); }
public override string ToConfig(IEventArgs args) { return("percent|" + current.ToConfig(args) + "->" + max.ToConfig(args)); }
public override string GetStyle(IEventArgs args) { return(string.Empty); }
public static void Set(Type objType, IPoolObject[] objs, IPoolObjectOwner owner, IEventArgs arg) { objs.ForEach((o) => { Set(objType, o, owner, arg); }); }
void OnNewWeight(IEventArgs eventArgs) { NewWeightEventArgs newWeight = (NewWeightEventArgs)eventArgs; currentWeight = newWeight.NewWeight; UpdateWeight(); }
protected override PoolObjInfo CreatNew(IEventArgs arg) { return(new PoolObjInfo()); }
private static void SetOne(PoolObjInfo o, IEventArgs arg) { Instance[o.type].Set(o.content, arg); }
private void OnSceneLoadingCallbak(object sender, IEventArgs e) { SceneLoadingEventArgs ne = (SceneLoadingEventArgs)e; Debug.Log("OnSceneLoadingCallbak:" + ne.SceneName + ",Progress:" + ne.Progress); }
public static void Set(Type objType, IPoolObject obj, IPoolObjectOwner owner, IEventArgs arg) { PoolObjInfo o = Instance.infos.Find((i) => { return(i.content == obj && i.type == objType && i.owner == owner); }); if (o == null) { Log.L("Not Find Same IPoolObject"); } else { SetOne(o, arg); } }
void OnMove(IEventArgs eventArgs) { MovementEventArgs movementArgs = (MovementEventArgs)eventArgs; horizontalAxis = movementArgs.HorizonalAxis; verticalAxis = movementArgs.VerticalAxis; }