AddListener() public static method

public static AddListener ( string eventType, Action, handler ) : void
eventType string
handler Action,
return void
 void OnEnable()
 {
     Messenger.AddListener <int>("init score", OnInitScore);
     Messenger.AddListener <int>("change score", OnChangeScore);
     Messenger.AddListener <bool>("fade hud", OnFadeHud);
 }
Exemplo n.º 2
0
 public void AddListener <T1, T2, T3>(string i_event, Callback <T1, T2, T3> i_handler)
 {
     Messenger.AddListener <T1, T2, T3>(i_event, i_handler);
 }
Exemplo n.º 3
0
 void Awake()
 {
     Messenger <float> .AddListener(GameEvent.SPEED_CHANGED, OnSpeedChanged);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Battles the notify init.
        /// </summary>
        public static void BattleNotifyInit()
        {
            Messenger.AddListener <string>(NotifyTypes.CreateBattle, (fightId) => {
                if (BattleFightPanelCtrl.Ctrl != null)
                {
                    Statics.CreatePopMsg(Vector3.zero, "已在战斗中", Color.white, 30);
                    return;
                }
                //获取队伍角色列表
//				RoleData currentRoleData = RoleInfoPanelCtrl.GetCurrentRoleData();
                RoleData currentRoleData = DbManager.Instance.GetHostRoleData();
                if (currentRoleData == null)
                {
                    return;
                }
                currentRoleData.MakeJsonToModel();
                if (currentRoleData.Injury == InjuryType.Moribund)
                {
                    AlertCtrl.Show("你已奄奄一息无法再战!", () => {
                        Messenger.Broadcast(NotifyTypes.BackToCity);
                    });
                    return;
                }
                //获取战斗数据
//				FightData fightData = new FightData();
//				fightData.Id = fightId;
//				fightData.Type = FightType.Normal;
//				RoleData enemy0 = new RoleData();
//				enemy0.Id = "enemy0";
//				enemy0.Name = "赏金刺客";
//				enemy0.HalfBodyId = "enemy000001";
//				BookData book0 = new BookData();
//				book0.Id = "book20001";
//				book0.Name = "地痞撒泼";
//				book0.IconId = "200000";
//				SkillData skill0 = new SkillData();
//				skill0.Type = SkillType.MagicAttack;
//				skill0.Name = "背负投";
//				BuffData buff0 = new BuffData();
//				buff0.Type = BuffType.Vertigo;
////				buff0.Value = 8888;
////				buff0.FirstEffect = true;
//				buff0.RoundNumber = 3;
//				buff0.Rate = 30;
//				buff0.FirstEffect = true;
//				skill0.DeBuffDatas.Add(buff0);
//				SkillData skill1 = new SkillData();
//				skill1.Type = SkillType.PhysicsAttack;
//				skill1.Name = "抱摔";
//				SkillData skill2 = new SkillData();
//				skill2.Type = SkillType.PhysicsAttack;
//				skill2.Name = "撕咬";
//				book0.Skills.Add(skill0);
//				book0.Skills.Add(skill1);
//				book0.Skills.Add(skill2);
//				enemy0.Books.Add(book0);
//				enemy0.AttackSpeed = 2;
//				enemy0.HP = 10000;
//				enemy0.MaxHP = 10000;
//				WeaponData weapon5 = new WeaponData();
//				weapon5.Id = "weapon5";
//				weapon5.Id = "阔刃刀";
//				weapon5.Width = 360;
//				weapon5.Rates = new float[] { 1, 0.6f, 0.2f, 0.1f };
//				enemy0.Weapon = weapon5;
//				fightData.Enemys = new List<RoleData>() {
//					enemy0
//				};
//                List<RoleData> teams = RoleInfoPanelCtrl.GetRoleDatas();
                List <RoleData> teams             = DbManager.Instance.GetRolesInTeam();
                List <List <SecretData> > secrets = new List <List <SecretData> >();
                for (int i = 0, len = teams.Count; i < len; i++)
                {
                    if (teams[i].IsHost)
                    {
                        WeaponLVData weaponLvData = DbManager.Instance.GetWeaponLV(teams[i].ResourceWeaponDataId);
                        teams[i].CurrentWeaponLV  = weaponLvData.LV;
                    }
                    teams[i].MakeJsonToModel();
                    secrets.Add(DbManager.Instance.GetSecretsBelongBooks(teams[i].ResourceBookDataIds));
                }
                FightData fightData = JsonManager.GetInstance().GetMapping <FightData>("Fights", fightId);
                fightData.MakeJsonToModel();
                Messenger.Broadcast(NotifyTypes.HideRoleInfoPanel);
                SoundManager.GetInstance().PauseBGM();
                SoundManager.GetInstance().PushSound("ui0003");
                Messenger.Broadcast <System.Action, System.Action>(NotifyTypes.PlayCameraVortex, () => {
//					BattleMainPanelCtrl.Show(currentRoleData, fightData);
                    List <ItemData> drugs = new List <ItemData>();
//                    drugs.Add(JsonManager.GetInstance().GetMapping<ItemData>("ItemDatas", "100001"));
//                    drugs.Add(JsonManager.GetInstance().GetMapping<ItemData>("ItemDatas", "100002"));
//                    drugs.Add(JsonManager.GetInstance().GetMapping<ItemData>("ItemDatas", "100003"));
                    List <ItemData> allVulnerary = DbManager.Instance.GetItems(ItemType.Drug);
                    for (int i = 0; i < 3; i++)
                    {
                        if (allVulnerary.Count > i)
                        {
                            drugs.Add(allVulnerary[i]);
                        }
                        else
                        {
                            break;
                        }
                    }
                    //处理通天塔量子强度影响的敌人成长率
                    if (UserModel.CurrentUserData.CurrentAreaSceneName == "Area31")
                    {
                        int difficulty = PlayerPrefs.GetInt("TowerDifficulty");
                        float growUp;
                        switch (difficulty)
                        {
                        case 0:
                        default:
                            growUp = 1;
                            break;

                        case 1:
                            growUp = 2;
                            break;

                        case 2:
                            growUp = 4;
                            break;
                        }
                        for (int i = 0, len = fightData.Enemys.Count; i < len; i++)
                        {
                            fightData.Enemys[i].SetGrowUp(growUp);
                        }
                    }
                    BattleFightPanelCtrl.Show(fightData, teams, secrets, fightData.Enemys, drugs, DbManager.Instance.GetProp(PropType.LimePowder));
                    PlayerPrefs.SetString("BattleIsGoingOn_FightFlag_For_" + DbManager.Instance.HostData.Id, fightId);
                }, () => {
//					Messenger.Broadcast<bool>(NotifyTypes.CallRoleInfoPanelData, true);
                });
            });

            Messenger.AddListener <List <RoleData>, string>(NotifyTypes.CreateTestBattle, (roles, fightId) => {
//                List<List<SecretData>> secrets = new List<List<SecretData>>();
//                for (int i = 0, len = roles.Count; i < len; i++) {
//                    secrets.Add(DbManager.Instance.GetSecretsBelongBooks(roles[i].ResourceBookDataIds));
//                }
                TextAsset asset = Resources.Load <TextAsset>("Data/Json/TestSecrets");
                List <List <SecretData> > secrets = PlayerPrefs.GetString("FightEditorUseSecret") == "true" ? JsonManager.GetInstance().DeserializeObject <List <List <SecretData> > >(asset.text) : new List <List <SecretData> >();
                FightData fightData = JsonManager.GetInstance().GetMapping <FightData>("Fights", fightId);
                fightData.MakeJsonToModel();
//				BattleMainPanelCtrl.Show(currentRoleData, fightData);
                List <ItemData> drugs = new List <ItemData>();
                drugs.Add(JsonManager.GetInstance().GetMapping <ItemData>("ItemDatas", "100001"));
                drugs.Add(JsonManager.GetInstance().GetMapping <ItemData>("ItemDatas", "100002"));
                drugs.Add(JsonManager.GetInstance().GetMapping <ItemData>("ItemDatas", "100003"));

                for (int i = 0, len = fightData.Enemys.Count; i < len; i++)
                {
                    fightData.Enemys[i].SetGrowUp(PlayerPrefs.GetFloat("FightEditorTestGroupUp"));
                }
                BattleFightPanelCtrl.Show(fightData, roles, secrets, fightData.Enemys, drugs, DbManager.Instance.GetProp(PropType.LimePowder));
            });

            Messenger.AddListener <bool, List <DropData>, FightData>(NotifyTypes.EndBattle, (win, drops, fightData) => {
                if (!win)
                {
                    MaiHandler.SendEvent("FightFail", DbManager.Instance.HostData.Lv.ToString(), fightData.Id);
                }
//				Messenger.Broadcast(NotifyTypes.HideRoleInfoPanel);
                Messenger.Broadcast <System.Action, System.Action>(NotifyTypes.PlayCameraVortex, () => {
                    //如果普通战斗失败则回之前到过的城镇去疗伤
                    if (fightData.Type == FightType.Normal && !win)
                    {
                        AlertCtrl.Show("江湖凶险, 稍事休息后再出发!", () => {
                            Messenger.Broadcast(NotifyTypes.BackToCity);
                            PlayerPrefs.SetString("BattleIsGoingOn_FightFlag_For_" + DbManager.Instance.HostData.Id, "");
                        });
                    }
                    else
                    {
                        PlayerPrefs.SetString("BattleIsGoingOn_FightFlag_For_" + DbManager.Instance.HostData.Id, "");
                    }
//					BattleMainPanelCtrl.Hide();
                    BattleFightPanelCtrl.Hide();
                }, () => {
                    //任务详情界面打开时不呼出角色信息板
                    if (TaskDetailInfoPanelCtrl.Ctrl == null)
                    {
                        Messenger.Broadcast <bool>(NotifyTypes.CallRoleInfoPanelData, false);
                    }
                    Messenger.Broadcast(NotifyTypes.PlayBgm);
                    if (drops.Count > 0)
                    {
                        Messenger.Broadcast <List <DropData> >(NotifyTypes.ShowDropsListPanel, drops);
                    }
                    if (fightData.Type == FightType.Task)
                    {
                        Messenger.Broadcast(NotifyTypes.ReloadTaslDetailInfoData);
                        if (win)
                        {
                            Messenger.Broadcast <string>(NotifyTypes.MakeFightWinedBtnDisable, fightData.Id);
                        }
                    }
                });
            });

            Messenger.AddListener <RoleData>(NotifyTypes.ChangeCurrentTeamRoleInBattle, (roleData) => {
                BattleMainPanelCtrl.ChangeCurrentTeamRole(roleData);
            });

            Messenger.AddListener <int>(NotifyTypes.ChangeCurrentTeamBookInBattle, (index) => {
                BattleMainPanelCtrl.ChangeCurrentTeamBook(index);
            });

            Messenger.AddListener <JArray, List <BookData> >(NotifyTypes.SendFightResult, (data, books) => {
                DbManager.Instance.SendFightResult((bool)data[0], data[1].ToString(), (int)data[2], (int)data[5], books, (float)data[6]);
                JArray usedSkillIdData = (JArray)data[3];
                JArray d;
                for (int i = 0; i < usedSkillIdData.Count; i++)
                {
                    d = (JArray)usedSkillIdData[i];
                    DbManager.Instance.UpdateUsedTheSkillRecords(d[0].ToString(), (int)d[1]);
                }
                JArray plusIndexData = (JArray)data[4];
                for (int i = 0; i < plusIndexData.Count; i++)
                {
                    d = (JArray)plusIndexData[i];
                    DbManager.Instance.UpdateWeaponPowerPlusSuccessedRecords((int)d[0], (int)d[1]);
                }
            });

            Messenger.AddListener <bool, List <DropData>, FightData>(NotifyTypes.SendFightResultEcho, (win, drops, fightData) => {
                //加载动态事件列表
                Messenger.Broadcast <string>(NotifyTypes.GetActiveEventsInArea, UserModel.CurrentUserData.CurrentAreaSceneName);
                Messenger.Broadcast <bool, List <DropData>, FightData>(NotifyTypes.EndBattle, win, drops, fightData);
            });

            Messenger.AddListener(NotifyTypes.BackToCity, () => {
                string eventId = JsonManager.GetInstance().GetMapping <string>("AreaCityPosDatas", UserModel.CurrentUserData.CurrentCitySceneId);
                string[] fen   = eventId.Split(new char[] { '_' });
                if (fen.Length >= 3)
                {
                    string areaName = fen[0];
                    int x           = int.Parse(fen[1]);
                    int y           = int.Parse(fen[2]);
                    if (UserModel.CurrentUserData != null)
                    {
                        UserModel.CurrentUserData.PositionStatu        = UserPositionStatusType.InCity;
                        UserModel.CurrentUserData.CurrentAreaSceneName = areaName;
                        UserModel.CurrentUserData.CurrentAreaX         = x;
                        UserModel.CurrentUserData.CurrentAreaY         = y;
                        Messenger.Broadcast <System.Action <UserData> >(NotifyTypes.UpdateUserData, null);
                        Messenger.Broadcast <string>(NotifyTypes.GoToScene, areaName);
                    }
                }
            });

            Messenger.AddListener(NotifyTypes.BattleFaild, () => {
                BattleMainPanelCtrl.MakeFaild();
            });

            Messenger.AddListener <string>(NotifyTypes.MakePopRole, (dieRoleId) => {
                RoleInfoPanelCtrl.MakePopRole(dieRoleId);
            });
        }
Exemplo n.º 5
0
 private void Awake()
 {
     Messenger.AddListener(GameEvent.WORLD_ITEM_TURN_START, OnWorldItemTurnStart);
 }
Exemplo n.º 6
0
 void OnEnable()
 {
     Messenger <PlayerControl> .AddListener("SetPlayer", SetPlayer);
 }
Exemplo n.º 7
0
 void RegisterMessage()
 {
     Messenger.AddListener <RewardData>(MessageId.MAP_GET_REWARD, GetMapReward);
     Messenger.AddListener <GCExitBattle>(MessageId_Receive.GCExitBattle, GetExitResponse);
 }
Exemplo n.º 8
0
        /// <summary>
        /// Scenes the notify init.
        /// </summary>
        public static void AreaNotifyInit()
        {
            Messenger.AddListener <AreaTarget, AreaMain>(NotifyTypes.AreaInit, (target, main) => {
                AreaModel.CurrentTarget  = target;
                AreaModel.AreaMainScript = main;
                //加载动态事件列表
                Messenger.Broadcast <string>(NotifyTypes.GetActiveEventsInArea, UserModel.CurrentUserData.CurrentAreaSceneName);
                //打开大地图UI交互界面
                Messenger.Broadcast(NotifyTypes.CallAreaMainPanelData);
                //如果当前所处的位置是城镇,则进入城镇
                if (UserModel.CurrentUserData.PositionStatu == UserPositionStatusType.InCity)
                {
                    Messenger.Broadcast <string>(NotifyTypes.EnterCityScene, UserModel.CurrentUserData.CurrentCitySceneId);
                }
            });

            Messenger.AddListener(NotifyTypes.AreaDestroyed, () => {
                if (AreaModel.CurrentTarget != null && AreaModel.CurrentTarget.gameObject != null)
                {
                    MonoBehaviour.Destroy(AreaModel.CurrentTarget.gameObject);
                    AreaModel.CurrentTarget = null;
                }
                Messenger.Broadcast(NotifyTypes.HideAreaMainPanel);
            });

            Messenger.AddListener(NotifyTypes.CallAreaMainPanelData, () => {
                Messenger.Broadcast <System.Action <UserData> >(NotifyTypes.CallUserData, (userData) => {
                    Messenger.Broadcast <JArray>(NotifyTypes.CallAreaMainPanelDataEcho, new JArray(userData.AreaFood.IconId, userData.AreaFood.Num, userData.AreaFood.MaxNum, userData.CurrentAreaSceneName));
                    Vector2 pos = new Vector2(userData.CurrentAreaX, userData.CurrentAreaY);
                    Messenger.Broadcast <Vector2, bool>(NotifyTypes.SetAreaPosition, pos, false);
                });
            });

            Messenger.AddListener <JArray>(NotifyTypes.CallAreaMainPanelDataEcho, (data) => {
                AreaMainPanelCtrl.Show(data);
            });

            Messenger.AddListener(NotifyTypes.HideAreaMainPanel, () => {
                AreaMainPanelCtrl.Hide();
            });

            Messenger.AddListener <string, bool>(NotifyTypes.MoveOnArea, (direction, duringMove) => {
                //移动前先判断移动目的地是否有战斗
                Vector2 nextMovePosition = AreaModel.CurrentTarget.GetNextMovePosition(direction);
                //判断前方是否是障碍
                tk2dRuntime.TileMap.TileInfo groundTile = AreaModel.CurrentTarget.GetTileInfo((int)nextMovePosition.x, (int)nextMovePosition.y, 0);
                //判断禁止通过的碰撞区域
                if (groundTile == null || groundTile.stringVal == "obstacle")
                {
                    return;
                }
                string fightEventId = string.Format("{0}_{1}_{2}", UserModel.CurrentUserData.CurrentAreaSceneName, (int)nextMovePosition.x, (int)nextMovePosition.y);
                EventData data;

                if (AreaMain.ActiveAreaEventsMapping.ContainsKey(fightEventId))
                {
                    data = AreaMain.ActiveAreaEventsMapping[fightEventId];
                    if (data.Type == SceneEventType.Battle)
                    {
                        ConfirmCtrl.Show("前方将有恶战,是否继续?", () => {
                            Messenger.Broadcast <string>(NotifyTypes.CreateBattle, data.EventId);
                        }, null, "动手", "撤退");
                        return;
                    }
                }
                else if (AreaMain.StaticAreaEventsMapping.ContainsKey(fightEventId))
                {
                    //判断静态事件是否禁用
                    if (!AreaMain.DisableEventIdMapping.ContainsKey(fightEventId))
                    {
                        data = AreaMain.StaticAreaEventsMapping[fightEventId];
                        if (data.Type == SceneEventType.Battle)
                        {
                            ConfirmCtrl.Show("前方将有恶战,是否继续?", () => {
                                Messenger.Broadcast <string>(NotifyTypes.CreateBattle, data.EventId);
                                //处理静态事件的预禁用操作
                                EventData disableEvent = new EventData();
                                disableEvent.Id        = fightEventId;
                                disableEvent.Type      = SceneEventType.DisableEvent;
                                disableEvent.X         = (int)nextMovePosition.x;
                                disableEvent.Y         = (int)nextMovePosition.y;
                                Messenger.Broadcast <EventData>(NotifyTypes.HandleDisableEvent, disableEvent);
                            }, null, "动手", "撤退");
                            return;
                        }
                        else if (data.OpenType != SceneEventOpenType.None)
                        {
                            //静态事件有一个开启判定类型
                            switch (data.OpenType)
                            {
                            case SceneEventOpenType.FightWined:
                                if (!DbManager.Instance.IsFightWined(data.OpenKey))
                                {
                                    ConfirmCtrl.Show(string.Format("前方有强敌守卫,是否硬闯?{0}", data.Notice), () => {
                                        Messenger.Broadcast <string>(NotifyTypes.CreateBattle, data.OpenKey);
                                    }, null, "动手", "撤退");
                                    return;
                                }
                                break;

                            case SceneEventOpenType.NeedItem:
                                if (DbManager.Instance.GetUsedItemNumByItemId(data.OpenKey) <= 0)
                                {
                                    ItemData item = JsonManager.GetInstance().GetMapping <ItemData>("ItemDatas", data.OpenKey);
                                    if (DbManager.Instance.GetItemNumByItemId(data.OpenKey) > 0)
                                    {
                                        ConfirmCtrl.Show(string.Format("需要交出<color=\"#1ABDE6\">{0}</color>才能通过", item.Name), () => {
                                            if (DbManager.Instance.CostItemFromBag(data.OpenKey, 1))
                                            {
                                                DbManager.Instance.UpdateUsedItemRecords(data.OpenKey, 1);
                                            }
                                        }, null, "给", "不给");
                                    }
                                    else
                                    {
                                        AlertCtrl.Show(string.Format("行囊里没有<color=\"#1ABDE6\">{0}</color>,不能过去!{1}", item.Name, data.Notice));
                                    }
                                    return;
                                }
                                break;

                            case SceneEventOpenType.NeedTasks:
                                if (!string.IsNullOrEmpty(data.StringValue))
                                {
                                    string[] taskIds = data.StringValue.Split(new char[] { '|' });
                                    if (!DbManager.Instance.HasAnyTask(taskIds))
                                    {
                                        AlertCtrl.Show(string.Format("前方暂时无法通过!\n<color=\"#00FF00\">{0}</color>", data.Notice));
                                        return;
                                    }
                                }
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                //判定体力是否足够移动
                DbManager.Instance.MoveOnArea(direction, duringMove);
//				Messenger.Broadcast<string, int, bool>(NotifyTypes.MoveOnAreaEcho, direction, 666, duringMove);
            });

            Messenger.AddListener <string, int, bool>(NotifyTypes.MoveOnAreaEcho, (direction, foodsNum, duringMove) => {
                AreaMainPanelCtrl.MakeArrowShow(direction, foodsNum);
                Vector2 pos = AreaModel.CurrentTarget.Move(direction, foodsNum > 0, duringMove);
                AreaMainPanelCtrl.MakeSetPosition(pos);
                if (foodsNum <= 0)
                {
                    AlertCtrl.Show("干粮耗尽, 先回城镇休整", () => {
                        Messenger.Broadcast(NotifyTypes.BackToCity);
                    });
                }
            });

            Messenger.AddListener <Vector2, bool>(NotifyTypes.SetAreaPosition, (pos, doEvent) => {
                AreaMainPanelCtrl.MakeSetPosition(pos);
                if (AreaModel.AreaMainScript != null)
                {
                    AreaModel.AreaMainScript.SetPosition(pos, doEvent);
                }
            });

            Messenger.AddListener <string>(NotifyTypes.GetActiveEventsInArea, (sceneId) => {
                DbManager.Instance.GetActiveEventsInArea(sceneId);
            });

            Messenger.AddListener <List <EventData> >(NotifyTypes.GetActiveEventsInAreaEcho, (events) => {
                if (AreaModel.AreaMainScript != null)
                {
                    AreaModel.AreaMainScript.UpdateActiveAreaEventsData(events);
                    AreaModel.AreaMainScript.RefreshActiveAreaEventsView();
                }
            });

            Messenger.AddListener <EventData>(NotifyTypes.HandleDisableEvent, (ev) => {
                if (AreaModel.AreaMainScript != null)
                {
                    AreaModel.AreaMainScript.HandleDisableEvent(ev);
                }
            });

            Messenger.AddListener <bool>(NotifyTypes.ReleaseDisableEvent, (win) => {
                if (AreaModel.AreaMainScript != null)
                {
                    AreaModel.AreaMainScript.ReleaseDisableEvent(win);
                }
            });

            Messenger.AddListener <string, EventData>(NotifyTypes.PushDisableEvent, (eventId, eventData) => {
                if (AreaModel.AreaMainScript != null)
                {
                    AreaModel.AreaMainScript.PushDisableEvent(eventId, eventData);
                }
            });

            Messenger.AddListener(NotifyTypes.ClearDisableEventIdMapping, () => {
                if (AreaModel.AreaMainScript != null)
                {
                    AreaModel.AreaMainScript.ClearDisableEventIdMapping();
                }
            });

            Messenger.AddListener <int>(NotifyTypes.EatFood, (num) => {
                int eatNum = DbManager.Instance.EatFood(num);
                AlertCtrl.Show(string.Format("打开包袱发现<color=\"#00FF00\">{0}个干粮</color>{1}", num, eatNum != num ? "\n你的行囊只装得下<color=\"#FF0000\">" + eatNum + "个</color>" : ""));
            });
        }
 void OnEnable()
 {
     //Add Listeners here
     Messenger.AddListener <int>("CountEnemies", CountEnemies);
 }
Exemplo n.º 10
0
 void OnEnable()
 {
     Messenger.AddListener <int>("load level", OnLoadLevel);
 }
Exemplo n.º 11
0
    // EVENTS

    public override void OnEnable()
    {
        base.OnEnable();

        Messenger <string> .AddListener(ButtonEvents.EVENT_BUTTON_CLICK, OnButtonClickEventHandler);
    }
Exemplo n.º 12
0
 void OnEnable()
 {
     Messenger.AddListener <bool>("save player data", OnSavePlayerData);
     Messenger.AddListener <bool>("load player data", OnLoadPlayerData);
 }
Exemplo n.º 13
0
 protected virtual void Awake()
 {
     _animController  = GetComponent <AnimationController>();
     _soundController = GetComponent <SoundController>();
     Messenger.AddListener <BattleResult>(Messages.OnBattleEnd, this.OnBattleEnd);
 }
Exemplo n.º 14
0
 private void OnEnable()
 {
     Messenger.AddListener("StartTimer", StartTimer);
     Messenger.AddListener("StopTimer", StopTimer);
 }
Exemplo n.º 15
0
 private void Start()
 {
     Messenger.AddListener(GameEvents.PLAYER_DEAD, OnPlayerDead);
     Messenger.AddListener(GameEvents.PLAYER_RESPAWNED, OnRespawnPlayer);
 }
Exemplo n.º 16
0
 private void OnEnable()
 {
     Messenger <int, bool> .AddListener("UserDecision", UserDecision);
 }
Exemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     paused = false;
     Messenger.AddListener(GameConstants.GameEvents.GAME_OVER, OnGameOver);
 }
Exemplo n.º 18
0
 // Use this for initialization
 void Start()
 {
     Messenger.AddListener(enableEvent, On);
     Messenger.AddListener(disableEvent, Off);
 }
Exemplo n.º 19
0
 void Awake()
 {
     // Listen for game-triggered events
     Messenger.AddListener(GameEvent.REX_INITIATE_END_SEQUENCE, RexInitiateEndSequence);
 }
Exemplo n.º 20
0
    //private PATileTerrain.PATile selectTile;

    void Awake()
    {
        Hide();
        Messenger <PATileTerrain.PATile> .AddListener(UIEvent.UIEvent_ShowSelectCrystal, OnShow);
    }
Exemplo n.º 21
0
 private void OnEnable()
 {
     Messenger <List <IFoundDevice> > .AddListener(SET_DATA, OnSetData);
 }
Exemplo n.º 22
0
 public void InitEvent()
 {
     Messenger.AddListener(SceneEvent.GAME_WIN, WinEvent);
     Messenger.AddListener(SceneEvent.GAME_OVER, FailEvent);
 }
Exemplo n.º 23
0
 public override void OnEnable()
 {
     Messenger.AddListener(EventName.OnURScoreRewardRecieve, delegate { SetScoreRewardRPState(); });
 }
Exemplo n.º 24
0
 // Use this for initialization
 void Start()
 {
     OnUpdataUserInfoCallBack();
     Messenger.AddListener(GameEvent.UPDATA_USER_INFO, OnUpdataUserInfoCallBack);
     //Messenger<JsonData>.AddListener (GameEvent.UPDATE_NICK_NAME, OnUpdataNickNameCallBack);
 }
Exemplo n.º 25
0
 public void AddListener(string i_event, Callback i_handler)
 {
     Messenger.AddListener(i_event, i_handler);
 }
Exemplo n.º 26
0
 public void OnEnable()
 {
     Messenger <int> .AddListener(BrickBreakerEvents.PlayerScore, OnPlayerScored);
 }
Exemplo n.º 27
0
 void Awake()
 {
     Messenger.AddListener(GameEvent.ENEMY_HIT, OnEnemyHit);
 }
Exemplo n.º 28
0
 private void OnEnable()
 {
     Messenger.AddListener <string, AbsSpr>(GameEvent.create_spr, AddSprEvent);
 }
Exemplo n.º 29
0
 void OnEnable()
 {
     Messenger <GameDraggableEditEnum> .AddListener(
         GameDraggableEditorMessages.EditState, OnEditStateHandler);
 }
Exemplo n.º 30
0
 private void Awake()
 {
     Messenger.AddListener("PlayerLive", PlayerLive);
     Messenger.AddListener("PlayerDie", PlayerDie);
 }