修改mesh
This commit is contained in:
31
Assets/Scripts/ThirdParty/Rope/Examples/02_BoxingRing/Spawner.cs
vendored
Normal file
31
Assets/Scripts/ThirdParty/Rope/Examples/02_BoxingRing/Spawner.cs
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Spawner : MonoBehaviour
|
||||
{
|
||||
public Transform prefab;
|
||||
public float randomRange = 0.5f;
|
||||
public float timeToSpawn = 4.0f;
|
||||
|
||||
private float timer;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
timer += Time.deltaTime;
|
||||
|
||||
if (timer >= timeToSpawn)
|
||||
{
|
||||
timer = 0.0f;
|
||||
|
||||
var obj = Instantiate(prefab, transform.position + Random.insideUnitSphere * randomRange, transform.rotation);
|
||||
obj.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDrawGizmos()
|
||||
{
|
||||
Gizmos.color = Color.yellow;
|
||||
Gizmos.DrawWireSphere(transform.position, randomRange);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user