Permalink
Cannot retrieve contributors at this time
Intro_Scritping/ShipShooter/Assets/Scripts/LegosteroidSpawner.cs
Go to fileusing UnityEngine; | |
using System.Collections; | |
public class LegosteroidSpawner : MonoBehaviour { | |
public GameObject asteroid; | |
public GameObject spawnAsteroid1; | |
public GameObject spawnAsteroid2; | |
public GameObject spawnAsteroid3; | |
public GameObject spawnAsteroid4; | |
// Use this for initialization | |
void Start () | |
{ | |
StartCoroutine(AsteroidSpawn()); | |
} | |
IEnumerator AsteroidSpawn() | |
{ | |
yield return new WaitForSeconds(5f); | |
spawnAsteroid1 = (GameObject)Instantiate(asteroid, new Vector3(-20.02866f, 11.89162f, 10f), Quaternion.identity); | |
iTween.MoveTo(spawnAsteroid1, new Vector3(31.74726f, -10.16816f, 10f), 10); | |
yield return new WaitForSeconds(3f); | |
spawnAsteroid1 = (GameObject)Instantiate(asteroid, new Vector3(-5.576063f, 14.47898f, 10f), Quaternion.identity); | |
iTween.MoveTo(spawnAsteroid1, new Vector3(-18.1424f, -11.79514f, 10f), 10); | |
yield return new WaitForSeconds(7f); | |
spawnAsteroid1 = (GameObject)Instantiate(asteroid, new Vector3(-19.92406f, 5.991251f, 10f), Quaternion.identity); | |
iTween.MoveTo(spawnAsteroid1, new Vector3(28.23111f, 10.77588f, 10f), 10); | |
yield return new WaitForSeconds(5f); | |
spawnAsteroid1 = (GameObject)Instantiate(asteroid, new Vector3(19.55236f, 14.41265f, 10f), Quaternion.identity); | |
iTween.MoveTo(spawnAsteroid1, new Vector3(5.40216f, -5.104211f, 10f), 10); | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |