重新导入obi

This commit is contained in:
2026-04-06 11:35:18 +08:00
parent 05fa2d6e5e
commit ae3002a0e2
1643 changed files with 232496 additions and 13 deletions

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
public class ActorSpawner : MonoBehaviour {
public ObiActor template;
public int basePhase = 2;
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 () {
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);
go.GetComponent<ObiActor>().SetFilterCategory(basePhase + phase);
phase++;
instances++;
timeFromLastSpawn = 0;
}
}
}