void OnUnitSpawn(UnitSpawnEventInfo unitSpawnEventInfo)
        {
            Debug.Log("BattlefieldController Alerted to unit Spawned: " + unitSpawnEventInfo.UnitGO.name);

            unitSpawnEventInfo.UnitSlotGO.GetComponent <UnitSlot>().SetIsOccupied(true);
            unitSpawnEventInfo.UnitSlotGO.GetComponent <UnitSlot>().SetOccupyingCharacter(unitSpawnEventInfo.UnitGO);
        }
Example #2
0
 void UnregisterEventCallbacks()
 {
     DeathEventInfo.UnregisterListener(OnUnitDied);
     HPChangedEventInfo.UnregisterListener(OnHPChange);
     MPChangedEventInfo.UnregisterListener(OnMPChange);
     UnitSpawnEventInfo.UnregisterListener(OnUnitSpawn);
     CharacterTurnOverEventInfo.UnregisterListener(OnTurnOver);
 }
Example #3
0
        public void UnregisterEventCallbacks()
        {
            SelectedObjectEventInfo.UnregisterListener(OnHighlightSelected);
            CharacterReadyEventInfo.UnregisterListener(OnCharacterReady);

            BattleWonEventInfo.UnregisterListener(OnBattleWon);
            HPChangedEventInfo.UnregisterListener(OnHPChange);
            MPChangedEventInfo.UnregisterListener(OnMPChange);
            HeroDeathEventInfo.UnregisterListener(OnHeroDeath);
            DeathEventInfo.UnregisterListener(OnUnitDied);
            UnitSpawnEventInfo.UnregisterListener(OnUnitSpawn);
        }
Example #4
0
        void OnUnitSpawn(UnitSpawnEventInfo unitSpawnEventInfo)
        {
            Debug.Log("CombatManager Alerted to unit Spawned: " + unitSpawnEventInfo.UnitGO.name);

            // We only care about freindly monsters at this point
            if (unitSpawnEventInfo.UnitGO.GetComponent <Character>().GetTeam == TeamName.Friendly)
            {
                // Also, we only care about monsters in out playerMonsterInfoList (i.e NOT the hero) <- this is because the hero can not be summoned
                if (playerMonsterinfoList.ContainsKey(unitSpawnEventInfo.UnitGO.GetComponent <Character>().GetUniqueID))
                {
                    playerMonsterinfoList[unitSpawnEventInfo.UnitGO.GetComponent <Character>().GetUniqueID].IsSummoned = true;

                    // Update Summon Menu
                    ActionMenu menu = monsterSpawner.PopulateHeroSummonMenu(GameManager.Instance.GetHeroData.heroWrapper.HeroData.HeroInfo);
                    playerCharacters[GameManager.Instance.GetHeroData.heroWrapper.HeroData.HeroInfo.PlayerName].GetComponent <Hero>().SetMenu(menu);
                }
            }

            // Add to character order list - All Charcaters
            AddToCharacterTurnOrder(unitSpawnEventInfo.UnitGO);
        }
Example #5
0
 void OnUnitSpawn(UnitSpawnEventInfo unitSpawnEventInfo)
 {
     Debug.Log("BattleUIController Alerted to unit Spawned: " + unitSpawnEventInfo.UnitGO.name);
     AddToCharacterPanel(unitSpawnEventInfo.UnitGO);
 }
 public void UnregisterEventCallbacks()
 {
     UnitSpawnEventInfo.UnregisterListener(OnUnitSpawn);
     DeathEventInfo.UnregisterListener(OnUnitDied);
 }
 void RegisterEventCallbacks()
 {
     UnitSpawnEventInfo.RegisterListener(OnUnitSpawn);
     DeathEventInfo.RegisterListener(OnUnitDied);
 }