33 lines
820 B
C#
33 lines
820 B
C#
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 LocalPropSetBasic : RandomProp {
|
|
|
|
public override void Process(RandomStream randomStream, Tile tile) {
|
|
var transformCount = transform.childCount;
|
|
var count = Mathf.Clamp(propCount.GetRandom(randomStream), 0, transformCount);
|
|
|
|
var array = new GameObject[transformCount];
|
|
for(var i = 0; i < transformCount; ++i){
|
|
array[i] = transform.GetChild(i).gameObject;
|
|
}
|
|
|
|
Utility.Shuffle(randomStream, array);
|
|
|
|
for(var i = count; i < transformCount; ++i){
|
|
UnityUtil.Destroy(array[i]);
|
|
}
|
|
|
|
}
|
|
|
|
public IntRange propCount = new IntRange(1, 1);
|
|
|
|
}
|
|
}
|