33 lines
704 B
C#
33 lines
704 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class RandomizeEverything : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField, Range(0, 360)] public float Rotate;
|
||
|
[SerializeField, Range(0.5f, 4.0f)] public float Scale;
|
||
|
|
||
|
// Start is called before the first frame update
|
||
|
void Start()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
[ContextMenu("Randomize")]
|
||
|
public void Randomize() {
|
||
|
for (int i = 0; i < gameObject.transform.childCount; i++)
|
||
|
{
|
||
|
Transform child = gameObject.transform.GetChild(i);
|
||
|
float TempRotate = Random.Range(0, Rotate);
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|