feat(gameplay): 更新单位属性和材质配置 - 调整多个单位的基础生命值和攻击力数值平衡 - 修改CoreBattleGround材质的纹理缩放比例 - 更新地砖材质颜色为白色 - 优化纹理资源设置,调整最大纹理尺寸并添加PlayableAds平台支持 - 修复弓箭手技能目标查找逻辑,改用统一的敌人检测方法 - 为水晶矿添加中立阵营设置和光球视觉效果同步 - 调整预制体中的全局缩放参数 - 为狼人和石巨人添加NavMeshAgent组件支持 - 优化水晶矿血条显示位置计算方式 ```
26 lines
857 B
C#
26 lines
857 B
C#
using Codely.Newtonsoft.Json.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace UnityTcp.Editor.Helpers
|
|
{
|
|
/// <summary>
|
|
/// Helper class for Vector3 operations
|
|
/// </summary>
|
|
public static class Vector3Helper
|
|
{
|
|
/// <summary>
|
|
/// Parses a JArray into a Vector3
|
|
/// </summary>
|
|
/// <param name="array">The array containing x, y, z coordinates</param>
|
|
/// <returns>A Vector3 with the parsed coordinates</returns>
|
|
/// <exception cref="System.Exception">Thrown when array is invalid</exception>
|
|
public static Vector3 ParseVector3(JArray array)
|
|
{
|
|
if (array == null || array.Count != 3)
|
|
throw new System.Exception("Vector3 must be an array of 3 floats [x, y, z].");
|
|
return new Vector3((float)array[0], (float)array[1], (float)array[2]);
|
|
}
|
|
}
|
|
}
|
|
|