修改水

This commit is contained in:
2026-01-01 22:00:33 +08:00
parent 040a222bd6
commit 9ceffccd39
1800 changed files with 103929 additions and 139495 deletions

View File

@@ -1,33 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
namespace Obi.Samples
{
public class ActorSpawner : MonoBehaviour
{
public class ActorSpawner : MonoBehaviour {
public ObiActor template;
public ObiActor template;
public int maxInstances = 32;
public float spawnDelay = 0.3f;
public int basePhase = 2;
public int maxInstances = 32;
public float spawnDelay = 0.3f;
private int instances = 0;
private float timeFromLastSpawn = 0;
private int phase = 0;
private int instances = 0;
private float timeFromLastSpawn = 0;
// Update is called once per frame
void Update () {
// Update is called once per frame
void Update()
{
timeFromLastSpawn += Time.deltaTime;
timeFromLastSpawn += Time.deltaTime;
if (Input.GetMouseButtonDown(0) && instances < maxInstances && timeFromLastSpawn > spawnDelay)
{
GameObject go = Instantiate(template.gameObject,transform.position,Quaternion.identity);
go.transform.SetParent(transform.parent);
if (Input.GetMouseButtonDown(0) && instances < maxInstances && timeFromLastSpawn > spawnDelay)
{
GameObject go = Instantiate(template.gameObject, transform.position, Quaternion.identity);
go.transform.SetParent(transform.parent);
instances++;
timeFromLastSpawn = 0;
}
}
}
}
go.GetComponent<ObiActor>().SetFilterCategory(basePhase + phase);
phase++;
instances++;
timeFromLastSpawn = 0;
}
}
}