using System.Collections; using System.Collections.Generic; using UnityEngine; /******************************************************************************* *Create By CG *Function 对象池管理_测试 *******************************************************************************/ namespace ZXK.Test { public class Bullet : MonoBehaviour { public void OnSpawn() { Debug.Log("生成游戏对象!"); } public void OnDespawn() { Debug.Log("回收游戏对象"); transform.position = Vector3.zero; GetComponent().velocity = Vector3.zero; } } }