using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AddRandomChilden : MonoBehaviour
{
// Debug.Log("开始进入update");
float i = 0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (i >1)
{
Debug.Log("开始创建sphere");;
int xRange=Random.Range(-10,10);
int zRange=Random.Range(-10,10);
GameObject objB = Instantiate(GameObject.CreatePrimitive(PrimitiveType.Sphere), transform);
objB.transform.position = new Vector3(xRange, 0,zRange);
objB.transform.localScale = new Vector3(0.3f, 0.3f,0.3f);
i = 0;
}
i += Time.deltaTime ;
Debug.Log(i);
}
}