コード例 #1
0
ファイル: Gun.cs プロジェクト: yimengfan/BDFramework.Core
    //Spawn pooled objects
    void FireBullet(Vector3 position, Quaternion rotation)
    {
        var bullet = BResources.LoadFormPool(bulletPath, position, rotation).GetComponent <Bullet>();

        //Notes:
        // bullet.gameObject.SetActive(true) is automatically called on spawn
        // When done with the instance, you MUST release it!
        // If the number of objects in use exceeds the pool size, new objects will be created
    }