コード例 #1
0
        public void LoadFromDefine(RPGStatCollectionDefine define, bool replaceIfExist)
        {
            if (define == null)
            {
                Debug.LogError($"LoadFromDefine: null");
                return;
            }

            foreach (var data in define.getDefinedCollection())
            {
                RPGStat stat = null;

                switch (data.type)
                {
                case RPGStatCollectionDefine.RPGStatType.RPGStat:
                    stat = new RPGStat()
                    {
                        StatBaseValue = data.defaultValue
                    }; break;

                case RPGStatCollectionDefine.RPGStatType.RPGStatModifiable:
                    stat = new RPGStatModifiable()
                    {
                        StatBaseValue = data.defaultValue
                    }; break;

                case RPGStatCollectionDefine.RPGStatType.RPGAttribute:
                    stat = new RPGAttribute()
                    {
                        StatBaseValue = data.defaultValue
                    }; break;

                case RPGStatCollectionDefine.RPGStatType.RPGVital:
                    stat = new RPGVital()
                    {
                        StatBaseValue = data.defaultValue
                    }; break;
                }

                AddStat(data.key, stat, replaceIfExist);

//                Debug.Log ( $"RPGStatCollection::LoadFromDefine() AddStat => {data.key.Colored(Colors.yellow)} {define}" );
            }
        }
コード例 #2
0
 public void LoadFromDefine(RPGStatCollectionDefine define, bool replaceIfExist)
 {
     _core.LoadFromDefine(define, replaceIfExist);
 }