コード例 #1
0
        void OnHighlightSelected(SelectedObjectEventInfo selectedEventInfo)
        {
            //if (abilityState == AbilityState.CharcterSelect)
            //{
            //    // record which freindly character has been selected
            //    SelectedCharacter = selectedEventInfo.UnitGO;

            //    // Create action panel for this character
            //    //abilityState = AbilityState.ActionSelect;
            //    TransferAbilityState(abilityState, AbilityState.ActionSelect);
            //    ActionPanel.SetActive(true);
            //    ActionPanelSetup(SelectedCharacter);
            //}

            if (abilityState == AbilityState.TargetSelect)
            {
                SelectedTarget = selectedEventInfo.UnitGO;
                TransferAbilityState(abilityState, AbilityState.ConfirmSelect);
            }
            else if (abilityState == AbilityState.ConfirmSelect)
            {
                TransferAbilityState(abilityState, AbilityState.CharcterSelect);

                SelectedAbility.NewAction(SelectedCharacter,
                                          selectedEventInfo.UnitGO);
            }
        }
コード例 #2
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);
        }