コード例 #1
0
        public void ShowTraitRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowTraitRewards()");

            ClearTraitRewardIcons();
            // show trait rewards
            CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(playerManager.ActiveCharacter);

            if (playerManager.MyCharacter.Faction != null)
            {
                CapabilityConsumerSnapshot capabilityConsumerSnapshot = new CapabilityConsumerSnapshot(playerManager.ActiveCharacter, systemGameManager);
                capabilityConsumerSnapshot.CharacterClass = characterClass;
                CapabilityProps capabilityPropsFaction = playerManager.MyCharacter.Faction.GetFilteredCapabilities(capabilityConsumerSnapshot, false);
                capabilityProps = capabilityPropsFaction.Join(capabilityProps);
            }

            List <StatusEffect> traitList = capabilityProps.TraitList.Distinct().ToList();

            if (traitList.Count > 0)
            {
                traitsArea.gameObject.SetActive(true);
            }
            else
            {
                traitsArea.gameObject.SetActive(false);
                return;
            }
            for (int i = 0; i < traitList.Count; i++)
            {
                if (traitList[i] != null)
                {
                    RewardButton rewardIcon = objectPooler.GetPooledObject(rewardIconPrefab, traitIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.Configure(systemGameManager);
                    rewardIcon.SetOptions(rectTransform, false);
                    rewardIcon.SetDescribable(traitList[i]);
                    traitRewardIcons.Add(rewardIcon);
                    if (traitList[i].RequiredLevel > playerManager.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text  = "Level\n" + traitList[i].RequiredLevel;
                        rewardIcon.HighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                    uINavigationControllers[1].AddActiveButton(rewardIcon);
                }
            }
        }
コード例 #2
0
        public void ShowAbilityRewards()
        {
            //Debug.Log("ClassChangePanelController.ShowAbilityRewards()");

            ClearRewardIcons();
            // show ability rewards
            CapabilityProps capabilityProps = characterClass.GetFilteredCapabilities(PlayerManager.MyInstance.ActiveCharacter);

            if (PlayerManager.MyInstance.MyCharacter.Faction != null)
            {
                CapabilityConsumerSnapshot capabilityConsumerSnapshot = new CapabilityConsumerSnapshot(PlayerManager.MyInstance.ActiveCharacter);
                capabilityConsumerSnapshot.CharacterClass = characterClass;
                CapabilityProps capabilityPropsFaction = PlayerManager.MyInstance.MyCharacter.Faction.GetFilteredCapabilities(capabilityConsumerSnapshot, false);
                capabilityProps = capabilityPropsFaction.Join(capabilityProps);
            }
            List <BaseAbility> abilityList = capabilityProps.AbilityList.Distinct().ToList();

            if (abilityList.Count > 0)
            {
                abilitiesArea.gameObject.SetActive(true);
            }
            else
            {
                abilitiesArea.gameObject.SetActive(false);
                return;
            }
            for (int i = 0; i < abilityList.Count; i++)
            {
                if (abilityList[i] != null)
                {
                    RewardButton rewardIcon = Instantiate(rewardIconPrefab, abilityIconsArea.transform).GetComponent <RewardButton>();
                    rewardIcon.SetDescribable(abilityList[i]);
                    abilityRewardIcons.Add(rewardIcon);
                    if (abilityList[i].RequiredLevel > PlayerManager.MyInstance.MyCharacter.CharacterStats.Level)
                    {
                        rewardIcon.StackSizeText.text    = "Level\n" + abilityList[i].RequiredLevel;
                        rewardIcon.MyHighlightIcon.color = new Color32(255, 255, 255, 80);
                    }
                }
            }
        }