Пример #1
0
 void OnNewWeightGoal(IEventArgs eventArgs)
 {
     NewTargetWeightEventArgs targetWeightArgs = (NewTargetWeightEventArgs)eventArgs;
     goalWeight = targetWeightArgs.GoalWeight;
     maxWeight = targetWeightArgs.MaxWeight;
     UpdateWeight();
 }
Пример #2
0
    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;
    }
Пример #3
0
    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));
    }
Пример #4
0
 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);
     }
 }
Пример #5
0
    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);
        }
    }
Пример #6
0
        private void OnSceneLoadedCallbak(object sender, IEventArgs e)
        {
            SceneLoadedEventArgs ne = (SceneLoadedEventArgs)e;

            Debug.Log("OnSceneLoadedCallbak:" + ne.SceneName);
        }
Пример #7
0
 protected override DelayedTask CreatNew(IEventArgs arg)
 {
     return(new DelayedTask());
 }
Пример #8
0
 protected override bool OnSet(DelayedTask t, IEventArgs arg)
 {
     t.action = null;
     return(base.OnSet(t, arg));
 }
Пример #9
0
 /// <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);
 }
Пример #10
0
 public override int GetKey(IEventArgs args)
 {
     return(EXP);
 }
Пример #11
0
 public static void Set <T>(T t, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject
 {
     Set(typeof(T), t, owner, arg);
 }
Пример #12
0
 public static void Clear <T>(IEventArgs arg, bool ignoreRun = true)
 {
     Clear(typeof(T), arg, ignoreRun);
 }
Пример #13
0
 public override IList <IFreeUIAuto> GetAutos(IEventArgs args)
 {
     return(autos);
 }
Пример #14
0
 public override string GetXyz(IEventArgs args, IPosSelector selector)
 {
     return(FreeUtil.ReplaceVar(xyz, args));
 }
Пример #15
0
 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));
 }
Пример #16
0
 public override int GetKey(IEventArgs args)
 {
     return(IMAGE);
 }
Пример #17
0
        private void OnHttpResponseFail(object sender, IEventArgs e)
        {
            HttpResponseFailEventArgs ne = (HttpResponseFailEventArgs)e;

            Debug.Log("OnHttpReadTextFailEventArgs:url:" + ne.Url + ",error:" + ne.Error);
        }
Пример #18
0
        private void OnHttpResponseSuccess(object sender, IEventArgs e)
        {
            HttpResponseSuccessEventArgs ne = (HttpResponseSuccessEventArgs)e;

            Debug.Log("OnHttpReadTextSuccess:url:" + ne.Url + ",content:" + ne.Content);
        }
Пример #19
0
        private void OnTestEventCallback(object sender, IEventArgs e)
        {
            TestEventArgs ne = (TestEventArgs)e;

            Debug.Log("OnTestEventCallback:" + ne.Parameters);
        }
Пример #20
0
 public static void Set(IPoolObject[] objs, IEventArgs arg)
 {
     objs.ForEach((o) => { Set(o, arg); });
 }
Пример #21
0
 public override string GetRotation(IEventArgs args, IPosSelector selector)
 {
     return(FreeUtil.ReplaceVar(rotation, args));
 }
Пример #22
0
 public static void Set <T>(T obj, IEventArgs arg) where T : IPoolObject
 {
     Set(typeof(T), obj, arg);
 }
Пример #23
0
 /// <summary>
 /// 发布消息
 /// </summary>
 /// <param name="message"></param>
 protected void Publish(IEventArgs message)
 {
     (context as IViewModel).Listen(message);
 }
Пример #24
0
 public static void Set <T>(T[] objs, IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject
 {
     objs.ForEach((o) => { Set(typeof(T), o, owner, arg); });
 }
Пример #25
0
 public static T Get <T>(IPoolObjectOwner owner, IEventArgs arg) where T : IPoolObject
 {
     return((T)Get(typeof(T), owner, arg));
 }
Пример #26
0
 public static void Clear(IPoolObject[] objs, IEventArgs arg, bool ignoreRun = true)
 {
     objs.ForEach((o) => { Clear(o, arg, ignoreRun); });
 }
Пример #27
0
 public static void AutoPutBomb(IEventArgs args, FreeData fd, ItemPosition item)
 {
 }
Пример #28
0
 public void AddHp(IEventArgs args)
 {
     AddHp((args as EventArgsInt).X);
 }
Пример #29
0
 public override string ToConfig(IEventArgs args)
 {
     return("percent|" + current.ToConfig(args) + "->" + max.ToConfig(args));
 }
Пример #30
0
 public override string GetStyle(IEventArgs args)
 {
     return(string.Empty);
 }
Пример #31
0
 public static void Set(Type objType, IPoolObject[] objs, IPoolObjectOwner owner, IEventArgs arg)
 {
     objs.ForEach((o) => { Set(objType, o, owner, arg); });
 }
Пример #32
0
 void OnNewWeight(IEventArgs eventArgs)
 {
     NewWeightEventArgs newWeight = (NewWeightEventArgs)eventArgs;
     currentWeight = newWeight.NewWeight;
     UpdateWeight();
 }
Пример #33
0
 protected override PoolObjInfo CreatNew(IEventArgs arg)
 {
     return(new PoolObjInfo());
 }
Пример #34
0
 private static void SetOne(PoolObjInfo o, IEventArgs arg)
 {
     Instance[o.type].Set(o.content, arg);
 }
Пример #35
0
        private void OnSceneLoadingCallbak(object sender, IEventArgs e)
        {
            SceneLoadingEventArgs ne = (SceneLoadingEventArgs)e;

            Debug.Log("OnSceneLoadingCallbak:" + ne.SceneName + ",Progress:" + ne.Progress);
        }
Пример #36
0
        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);
            }
        }
Пример #37
0
 void OnMove(IEventArgs eventArgs)
 {
     MovementEventArgs movementArgs = (MovementEventArgs)eventArgs;
     horizontalAxis = movementArgs.HorizonalAxis;
     verticalAxis = movementArgs.VerticalAxis;
 }