56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using LC.Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using cfg.BuffCfg;
|
|
using cfg.SkillCfg;
|
|
using Gameplay;
|
|
using Gameplay.Buff;
|
|
using Gameplay.Character;
|
|
using Gameplay.Unit.Data;
|
|
using PhxhSDK.Phxh;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
[Serializable]
|
|
public class MapBlockData
|
|
{
|
|
public int TerrainTypeIndex = -1;
|
|
|
|
public bool IsDefaultTerrainType()
|
|
{
|
|
return TerrainTypeIndex == -1;
|
|
}
|
|
|
|
public TerrainTypeProperty GetTerrainTypeProperty()
|
|
{
|
|
var props = TerrainTypeConfig.TerrainTypeProperties;
|
|
if (props != null && TerrainTypeIndex >= 0 && TerrainTypeIndex < props.Count)
|
|
{
|
|
return props[TerrainTypeIndex];
|
|
}
|
|
|
|
return TerrainTypeConfig.DefaultTerrainTypeProperty;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class TerrainTypeProperty
|
|
{
|
|
[HideInInspector] public int id;
|
|
public string name;
|
|
public bool selectable;
|
|
public bool banAttack;
|
|
public int crossLevel;
|
|
|
|
public bool AddBuff;
|
|
|
|
[ShowIf("AddBuff")] public int[] buffIds;
|
|
[ShowIf("AddBuff")] public EGameUnitType buffUnitType;
|
|
[ShowIf("AddBuff")] public EBlockBuffSideType buffSideType;
|
|
|
|
[HideInInspector] public string buffObjectPath;
|
|
|
|
[JsonConverter(typeof(ColorJsonConverter))]
|
|
public Color Color;
|
|
} |