Skip to content
Permalink
2f0f037344
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
34 lines (25 sloc) 625 Bytes
using UnityEngine;
using System.Collections;
public class SPawner : MonoBehaviour {
public int ballCount = 0;
public int ballCountMax = 10;
public GameObject paddleBall;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void SpawnBall1Wrap()
{
StartCoroutine (SpawnBall1 ());
}
IEnumerator SpawnBall1()
{
while (ballCount < ballCountMax) {
Instantiate(paddleBall, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity);
ballCount++;
yield return new WaitForSeconds(4f);
}
}
}