コード例 #1
0
        void OnUpgrading()
        {
            if (CheckGradeListOk(out List <SpiritData> grades))
            {
                var upgradedSpiritPrefab = Instantiate(
                    grades[ChoosedSpirit.Data.GradeCount + 1].Prefab,
                    ChoosedSpirit.Prefab.transform.position,
                    Quaternion.identity,
                    ReferenceHolder.Instance.SpiritParent);
                var upgradedSpirit = new SpiritSystem(upgradedSpiritPrefab, true);

                upgradedSpirit.Upgrade(ChoosedSpirit, grades[ChoosedSpirit.Data.GradeCount + 1]);
                upgradedSpirit.SetSystem(Owner);

                SpiritUpgraded?.Invoke(upgradedSpirit);
                SpiritSold?.Invoke(ChoosedSpirit);
                ChoosedSpirit = upgradedSpirit;
            }
            Owner.SpiritUISystem.ActivateUpgradeButton(ChoosedSpirit.Data.GradeCount < grades.Count - 1);
        }
コード例 #2
0
 void OnSelling() => SpiritSold?.Invoke(ChoosedSpirit);