Advertisement
Guest User

Adventure Creator - MainCamera script

a guest
Oct 14th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using AC;
  4.  
  5. public class ChangeSkybox : MonoBehaviour
  6. {
  7.    
  8.     MainCamera mainCamera;
  9.    
  10.     void Awake ()
  11.     {
  12.         mainCamera = GetComponent <MainCamera>();
  13.     }
  14.    
  15.     void Update ()
  16.     {
  17.         if (mainCamera.attachedCamera)
  18.         {
  19.             GetComponent<Camera>().GetComponent <Skybox>().material = mainCamera.attachedCamera.GetComponent <Skybox>().material;
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement