45 lines
1013 B
C#
45 lines
1013 B
C#
using LC.Newtonsoft.Json;
|
|
using System;
|
|
using Gameplay;
|
|
using PhxhSDK.Phxh;
|
|
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
|
|
{
|
|
public string name;
|
|
public bool selectable;
|
|
[FormerlySerializedAs("canPass")] public bool emptyBlock;
|
|
public bool banAttack;
|
|
public bool banGFX;
|
|
public int crossLevel;
|
|
|
|
[JsonConverter(typeof(ColorJsonConverter))]
|
|
public Color Color;
|
|
}
|
|
|
|
|
|
|