示例#1
0
    private void SpawnCannonball()
    {
        // Pick a treasure
        Treasure   target = treasures.PickRandom();
        Cannonball cb     = Instantiate(cannonballPrefab);

        cb.transform.position = new Vector3(5f, Random.Range(-3f, 3f));
        cb.Launch(target);
    }