2023-12-20 19:25:48 +08:00
|
|
|
using LC.Newtonsoft.Json;
|
2023-08-22 19:08:45 +08:00
|
|
|
using System;
|
2024-03-26 12:19:26 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using cfg.BuffCfg;
|
2024-03-26 12:38:24 +08:00
|
|
|
using cfg.SkillCfg;
|
2023-08-22 19:08:45 +08:00
|
|
|
using Gameplay;
|
2024-03-26 12:19:26 +08:00
|
|
|
using Gameplay.Buff;
|
|
|
|
|
using Gameplay.Character;
|
|
|
|
|
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;
|
|
|
|
|
using UnityEngine.Serialization;
|
|
|
|
|
|
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
|
|
|
|
|
{
|
2024-12-13 18:07:39 +08:00
|
|
|
[HideInInspector]
|
|
|
|
|
public int id;
|
2023-08-22 19:08:45 +08:00
|
|
|
public string name;
|
|
|
|
|
public bool selectable;
|
|
|
|
|
public bool banAttack;
|
|
|
|
|
public int crossLevel;
|
|
|
|
|
|
2024-03-26 12:19:26 +08:00
|
|
|
public bool AddBuff;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2024-03-26 12:38:24 +08:00
|
|
|
[ShowIf("AddBuff")] public int[] buffIds;
|
|
|
|
|
[ShowIf("AddBuff")] public EGameUnitType buffUnitType;
|
|
|
|
|
[ShowIf("AddBuff")] public EBlockBuffSideType buffSideType;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2024-03-26 12:19:26 +08:00
|
|
|
[JsonConverter(typeof(ColorJsonConverter))]
|
|
|
|
|
public Color Color;
|
2024-03-26 12:38:24 +08:00
|
|
|
|
2024-03-26 12:19:26 +08:00
|
|
|
}
|