Guest User

Untitled

a guest
Jan 21st, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. public class GameManager : MonoBehaviour {
  2.  
  3.     BackgroundGenerator backgroundGenerator;
  4.  
  5.     void Start () {
  6.         backgroundGenerator = GetComponent<BackgroundGenerator>();
  7.         backgroundGenerator.GenerateBackground(new Vector2(transform.position.x, transform.position.y), new Quaternion(0, 0, 0, 0));
  8.     }
  9.    
  10.     void Update () {
  11.    
  12.     }
  13. }
  14.  
  15. public class BackgroundGenerator : MonoBehaviour {
  16.  
  17.     public GameObject sky01;
  18.     public GameObject mountains01;
  19.  
  20.     public float forest01Speed = 50;
  21.     public float mountains01Speed = 1;
  22.  
  23.     Forest forest;
  24.  
  25.     void Start () {
  26.         forest = GetComponent<Forest>();
  27.  
  28.     }
  29.    
  30.     void Update () {
  31.  
  32.     }
  33.  
  34.     public void GenerateBackground(Vector3 position, Quaternion rotation)
  35.     {
  36.         Instantiate(forest01, position, rotation);
  37.         Instantiate(mountains01, position, rotation);
  38.         Instantiate(sky01, position, rotation);
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment