Exemplo n.º 1
0
        /// <summary>
        /// 获取或创建移动消耗
        /// </summary>
        /// <param name="classType"></param>
        /// <returns></returns>
        public MoveConsumption GetOrCreateMoveConsumption(ClassType classType)
        {
            if (!moveConsumptions.TryGetValue(classType, out MoveConsumption consumption))
            {
                MoveConsumptionInfoConfig config = DR.Book.SRPG_Dev.Framework.ConfigFile.Get <MoveConsumptionInfoConfig>();
                MoveConsumptionInfo       info   = config[classType];
                if (info == null)
                {
                    Debug.LogErrorFormat("RoleModel -> MoveConsumption key `{0}` is not found.", classType.ToString());
                    return(null);
                }
                consumption = new MoveConsumption(info);
                moveConsumptions.Add(classType, consumption);
            }

            return(consumption);
        }
Exemplo n.º 2
0
 public MoveConsumption(MoveConsumptionInfo info)
 {
     this.info = info;
 }