NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/GameWrapper/Map/MapBlockData.cs

53 lines
1.2 KiB
C#
Raw Normal View History

2023-12-20 19:25:48 +08:00
using LC.Newtonsoft.Json;
2023-08-22 19:08:45 +08:00
using System;
using Gameplay;
2024-03-26 12:19:26 +08:00
using Gameplay.Unit.Data;
2023-11-30 15:47:49 +08:00
using PhxhSDK.Phxh;
2024-03-26 12:19:26 +08:00
using Sirenix.OdinInspector;
2023-08-22 19:08:45 +08:00
using UnityEngine;
2023-11-19 22:57:17 +08:00
[Serializable]
2023-08-22 19:08:45 +08:00
public class MapBlockData
{
2023-12-18 19:42:46 +08:00
public int TerrainTypeIndex = -1;
2024-03-26 12:19:26 +08:00
2023-08-22 19:08:45 +08:00
public bool IsDefaultTerrainType()
{
return TerrainTypeIndex == -1;
}
public TerrainTypeProperty GetTerrainTypeProperty()
{
var props = TerrainTypeConfig.TerrainTypeProperties;
if (props != null && TerrainTypeIndex >= 0 && TerrainTypeIndex < props.Count)
{
return props[TerrainTypeIndex];
}
2024-03-26 12:19:26 +08:00
2023-08-22 19:08:45 +08:00
return TerrainTypeConfig.DefaultTerrainTypeProperty;
}
}
[Serializable]
public class TerrainTypeProperty
{
[HideInInspector] public int id = -1;
2023-08-22 19:08:45 +08:00
public string name;
public bool selectable;
public bool banAttack;
public int crossLevel;
2025-06-24 13:09:34 +08:00
/// <summary>
/// 通行标记
/// </summary>
public int[] crossTagIds = {};
2024-03-26 12:19:26 +08:00
public bool AddBuff;
2023-08-22 19:08:45 +08:00
2025-06-05 18:43:49 +08:00
[ShowIf("AddBuff")] public int[] bulletIds;
2023-08-22 19:08:45 +08:00
[HideInInspector] public string buffObjectPath;
2024-03-26 12:19:26 +08:00
[JsonConverter(typeof(ColorJsonConverter))]
public Color Color;
}