扩充游戏内容,保持敌人基本行为不变,使用缩放和颜色区分不同敌人
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.DataTable
|
||||
@@ -30,6 +31,10 @@ namespace SepCore.DataTable
|
||||
|
||||
public float DropPercent { get; private set; }
|
||||
|
||||
public float Scale { get; private set; } = 1f;
|
||||
|
||||
public Color Color { get; private set; } = Color.white;
|
||||
|
||||
public Dictionary<string, string> Params { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
@@ -50,17 +55,23 @@ namespace SepCore.DataTable
|
||||
DropCoin = int.Parse(columnStrings[index++]);
|
||||
DropExp = int.Parse(columnStrings[index++]);
|
||||
DropPercent = float.Parse(columnStrings[index++]);
|
||||
Scale = float.Parse(columnStrings[index++]);
|
||||
Color = ParseColor(columnStrings[index++]);
|
||||
Params = DeserializeParams(columnStrings[index++]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解参数
|
||||
/// </summary>
|
||||
/// <param name="rawParams"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
private static Color ParseColor(string raw)
|
||||
{
|
||||
if (ColorUtility.TryParseHtmlString(raw.Trim(), out Color color))
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
return Color.white;
|
||||
}
|
||||
|
||||
private Dictionary<string, string> DeserializeParams(string rawParams)
|
||||
{
|
||||
if (!rawParams.StartsWith('[') || !rawParams.EndsWith(']'))
|
||||
|
||||
Reference in New Issue
Block a user