Permalink
Cannot retrieve contributors at this time
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?
Intro_Scritping/ShipShooter/Assets/Scripts/LegosteroidSpawner.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
42 lines (32 sloc)
1.47 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using 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 () { | |
} | |
} |