mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 07:27:12 +08:00
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/56
52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
using System.Collections.Generic;
|
||
using System.Xml.Linq;
|
||
using UnityEngine;
|
||
using UnityEngine.Tilemaps;
|
||
|
||
namespace Data
|
||
{
|
||
public class TileDef : Define
|
||
{
|
||
public Tile.ColliderType collider = Tile.ColliderType.None;
|
||
public string texture;
|
||
public RuleTileRuleDef[] rules;
|
||
}
|
||
|
||
public class RuleTileRuleDef : Define
|
||
{
|
||
public enum NeighborConditionType
|
||
{
|
||
Any, // 可以是任何瓦片
|
||
This, // 必须是当前 Rule Tile 自身 (用于[4]位置)
|
||
NotThis, // 不能是当前 Rule Tile 自身
|
||
}
|
||
|
||
public NeighborConditionType[] neighborConditions = new NeighborConditionType[8];
|
||
|
||
public RuleTile.TilingRuleOutput.OutputSprite outputType = RuleTile.TilingRuleOutput.OutputSprite.Single;
|
||
public RuleTile.TilingRuleOutput.Transform transform = RuleTile.TilingRuleOutput.Transform.Fixed;
|
||
|
||
// --- 输出碰撞器类型 (Output Collider Type) ---
|
||
// 如果需要为该规则设置特定的碰撞器类型
|
||
public Tile.ColliderType outputCollider = Tile.ColliderType.None;
|
||
|
||
// --- 概率 (Probability) / Perlin Offset ---
|
||
// 决定此规则被选中的可能性,或者用于Perlin噪声偏移
|
||
public float chance = 0.5f; // 默认为100%
|
||
|
||
// --- 动画精灵 (Animation Sprites) ---
|
||
// 如果 outputType 是 Animation,这里可以定义一系列动画帧的纹理路径或名称
|
||
public List<string> animationTextures;
|
||
public float animationSpeed = 1f;
|
||
|
||
// 构造函数或其他辅助方法
|
||
public RuleTileRuleDef()
|
||
{
|
||
for (int i = 0; i < neighborConditions.Length; i++)
|
||
{
|
||
neighborConditions[i] = NeighborConditionType.Any;
|
||
}
|
||
}
|
||
}
|
||
|
||
} |