扩充游戏内容,保持敌人基本行为不变,使用缩放和颜色区分不同敌人

This commit is contained in:
SepComet
2026-06-16 17:09:19 +08:00
committed by basil
parent 29c4468d54
commit 649930c666
26 changed files with 812 additions and 235 deletions
@@ -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(']'))