ren811

ApagaCenario.cs

Dec 13th, 2013
87
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.  
  4. public class ApagaCenario : MonoBehaviour {
  5.  
  6.     // Use this for initialization
  7.     void Start () {
  8.    
  9.     }
  10.    
  11.     void DestroyThis()
  12.     {
  13.         Destroy (gameObject);
  14.         Destroy (this);
  15.     }
  16.    
  17.     // Update is called once per frame
  18.     void Update ()
  19.     {
  20.         if (gameObject.transform.position.z < Camera.main.transform.position.z)
  21.         {
  22.             DestroyThis();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment