Grass Cutters Together: the project as of moon-sweepers f3666f0
A clean start for the shared repository: the Unity project (Assets, Packages, ProjectSettings), ArtSource, Docs and Tools as they stood at f3666f0 in the old local repository, with its generated prefabs and scene brought up to date. Images, audio, models and binaries go through Git LFS (.gitattributes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
27
Assets/Scripts/World/DeckTileView.cs
Normal file
27
Assets/Scripts/World/DeckTileView.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GrassCutter
|
||||
{
|
||||
/// <summary>One floating 6x6 deck tile (client-side visual + colliders, built from TeamState.Tiles).</summary>
|
||||
public class DeckTileView : MonoBehaviour
|
||||
{
|
||||
public Vector2Int tile;
|
||||
public GameObject railN, railS, railE, railW;
|
||||
public BoxCollider colN, colS, colE, colW;
|
||||
public Transform ladderRoot;
|
||||
|
||||
public void SetEdges(bool n, bool s, bool e, bool w)
|
||||
{
|
||||
void Set(GameObject rail, BoxCollider col, bool open)
|
||||
{
|
||||
if (rail) rail.SetActive(open);
|
||||
if (col) col.enabled = open;
|
||||
}
|
||||
Set(railN, colN, n); Set(railS, colS, s); Set(railE, colE, e); Set(railW, colW, w);
|
||||
if (ladderRoot)
|
||||
for (int i = 0; i < ladderRoot.childCount && i < 4; i++)
|
||||
ladderRoot.GetChild(i).gameObject.SetActive(i == 0 ? n : i == 1 ? s : i == 2 ? e : w);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user