升级obi

This commit is contained in:
2026-01-22 22:08:21 +08:00
parent 120b8cda26
commit 20f14322bc
1067 changed files with 149894 additions and 29583 deletions

View File

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