Exemplo n.º 1
0
 private void Awake()
 {
     m_BattleScene = FindObjectOfType <BattleScene>();
     fightSettings = new FightSettings();
     EventMessenger.AddListener <HeroData>(SelectionEvents.HERO_FRAME_SELECTED, OnMenuHeroSelected);
     EventMessenger.AddListener <HeroData>(SelectionEvents.HERO_FRAME_DESELECTED, OnMenuHeroDeselected);
     EventMessenger.AddListener(SceneEvents.BATTLE_START_SIGNAL, OnBattleStart);
     EventMessenger.AddListener(SceneEvents.REWARDING_COMPLETE, LoadMenu);
 }
Exemplo n.º 2
0
    private void Awake()
    {
        m_AudioSource = GetComponent <AudioSource>();

        EventMessenger.AddListener <HeroData>(SelectionEvents.HERO_FRAME_SELECTED, PlaySelectionSound);
        EventMessenger.AddListener <HeroData>(SelectionEvents.HERO_FRAME_DESELECTED, PlaySelectionSound);

        EventMessenger.AddListener <BattleHero, int>(FightEvents.DAMAGE_DONE, PlayAttackSound);
        EventMessenger.AddListener(SceneEvents.BATTLE_START_SIGNAL, PlayButtonSound);
    }
Exemplo n.º 3
0
    void Start()
    {
        uiHeros = new List <UIHero>();

        for (int i = 0; i < HeroManager.MAX_AVAILABLE_HERO_COUNT; ++i)
        {
            uiHeros.Add(Instantiate(m_UIHeroPrefab, m_HeroLayout.transform).GetComponent <UIHero>());
        }

        EventMessenger.AddListener(HeroEvents.HERO_ADDED, Refresh);
        EventMessenger.AddListener <HeroData>(SelectionEvents.HERO_FRAME_SELECTED, OnHeroSelected);
        EventMessenger.AddListener <HeroData>(SelectionEvents.HERO_FRAME_DESELECTED, OnHeroDeselected);
        EventMessenger.AddListener(SceneEvents.REWARDING_COMPLETE, LoadMenu);
    }
Exemplo n.º 4
0
    private void Start()
    {
        Debug.Assert(m_PlayerHeroes.Length >= MissionManager.PLAYER_SIDE_COUNT &&
                     m_EnemyHeroes.Length >= MissionManager.ENEMY_SIDE_COUNT);

        m_BackButton = transform.Find("MainMenuButton").gameObject;
        m_BackButton.GetComponent <Button>().onClick.AddListener(() => EventMessenger.NotifyEvent(SceneEvents.REWARDING_COMPLETE));

        m_AttackEffecPool        = new GameObjectPool <AttackEffect>(3, m_AttackEffects, m_AttackEffectPrefab);
        AttribueChangeEffectPool = new GameObjectPool <AttributeChange>(4, m_AttributeChangeEffects, m_AttribueChangeEffectPrefab);

        m_AttackEffecPool.DeactivateAll();
        AttribueChangeEffectPool.DeactivateAll();

        EventMessenger.AddListener(FightEvents.ATTACK_SIGNAL_GIVEN, AttackSignalGiven);
        EventMessenger.AddListener(FightEvents.ATTACK_COMPLETED, AttackCompleted);
        EventMessenger.AddListener <BattleHero, int>(FightEvents.DAMAGE_DONE, DamageDoneOnHero);
        EventMessenger.AddListener <BattleHero>(FightEvents.HERO_DIED, OnHeroDied);
        EventMessenger.AddListener(FightEvents.ALL_ALLY_DEAD, OnDefeat);
        EventMessenger.AddListener(FightEvents.ALL_ENEMY_DEAD, OnVictory);

        EventMessenger.AddListener(SaveEvents.LOADING_SAVE_COMPLETED, LoadBattleSceneSettings);
    }
Exemplo n.º 5
0
 private void Awake()
 {
     EventMessenger.AddListener(LoadingEvents.LOADING_STARTED, StartLoading);
     EventMessenger.AddListener(LoadingEvents.LOADING_FINISHED, LoadingFinished);
     EventMessenger.AddListener <int, int>(LoadingEvents.LOADING_PROGRESS, UpdateLoadingBar);
 }
Exemplo n.º 6
0
 private void RegisterEvent()
 {
     Debug.Log("Start Listening...");
     EventMessenger.AddListener(EventMessage.ID.MyEventID, m_eventCallback);
 }
Exemplo n.º 7
0
 private void Start()
 {
     EventMessenger.AddListener(SaveEvents.GAME_RESET, GameReset);
 }
 private void Awake()
 {
     EventMessenger.AddListener <HeroBase>(SelectionEvents.HERO_FRAME_CLICKED_DOWN, OnHeroFrameClicked);
     EventMessenger.AddListener <Action>(SelectionEvents.HERO_FRAME_CLICKED_UP, OnHeroFrameMouseUp);
 }
Exemplo n.º 9
0
 private void Awake()
 {
     EventMessenger.AddListener(SceneEvents.REWARD_MATCH_COUNT, AddNewHero);
 }
 private void Awake()
 {
     EventMessenger.AddListener(SaveEvents.SAVE_GAME_STATE, SaveGameData);
     EventMessenger.AddListener(SaveEvents.GAME_RESET, DeleteSave);
 }