예제 #1
0
	// Use this for initialization
	void Start () {
        if (Instance == null)
            Instance = this;
        else
            Destroy(gameObject);

	    for (int i = 0; i < MAX_BULLETS; i++)
	    {
            ShmupBullet b = ((GameObject)Instantiate(BulletPrefab)).GetComponent<ShmupBullet>();
	        b.transform.parent = transform;
            b.gameObject.SetActive(false);
	        Bullets.Add(b);
	    }
	}
예제 #2
0
    // Use this for initialization
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        for (int i = 0; i < MAX_BULLETS; i++)
        {
            ShmupBullet b = ((GameObject)Instantiate(BulletPrefab)).GetComponent <ShmupBullet>();
            b.transform.parent = transform;
            b.gameObject.SetActive(false);
            Bullets.Add(b);
        }
    }