Files
HelixJump/Assets/DarkMatter/Code/Domain/Platforms/FirstPlatformRule.cs
2025-12-17 15:50:28 -08:00

20 lines
570 B
C#

using Darkmatter.Core;
using UnityEngine;
namespace Darkmatter.Domain
{
public class FirstPlatformRule : IPlatformRule
{
public void Execute(IPlatform platform)
{
foreach (var piece in platform.platformPiece)
{
piece.gameObject.SetActive(true);
piece.GetComponent<Renderer>().material = platform.safeMaterial;
piece.tag = "Safe";
}
platform.platformPiece[Random.Range(1, platform.platformPiece.Count)].gameObject.SetActive(false);
}
}
}