using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; using DunGen; namespace ScarletMansion.GamePatch.Props { public class RandomPrefabCycle : RandomPrefabBase { public static int cycle = 0; public static void UpdateCycle(int value){ Plugin.logger.LogDebug($"Updating RandomPrefab cylce to {value}"); cycle = value; } public override void Process(RandomStream randomStream, Tile tile) { if (props.Count <= 0) return; Plugin.logger.LogDebug($"Cycle {cycle}"); var cycleValue = cycle++; var index = cycleValue % props.Count; var prefab = props[index]; SpawnGameObject(randomStream, prefab); } } }