Advertisement
Jellybit

ShowHideOnStart.cs - Show or Hide an object on start.

Jun 14th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. //This script shows or hides an object on start. Nice for cleaning up the editor. If you use a lot of objects, might wanna
  5. //make a version of this that goes through a list of objects.
  6.  
  7. public class ShowHideOnStart : MonoBehaviour {
  8.  
  9.     public enum Action {Show, Hide}
  10.     public Action actionOnStart;
  11.  
  12.     void Start () {
  13.    
  14.         if( actionOnStart == Action.Show )
  15.             renderer.enabled = true;
  16.         else
  17.             renderer.enabled = false;
  18.  
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement