Created
October 27, 2016 14:15
-
-
Save arunkarnann/e2b844bfe391524cd4fa263a91e3b3aa to your computer and use it in GitHub Desktop.
A simple Unity3D Editor script to toggle canvas setactive. Useful when you want to design something in Editor and often messing up by selecting canvas instead of objects.
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; | |
using UnityEditor; | |
public class CanvasToggler : Editor { | |
public static GameObject[] canvases = GameObject.FindGameObjectsWithTag("Canvas") as GameObject[]; | |
[MenuItem("Editor Tools/Toggle canvas")] | |
static void ActivateOrDeactivate(){ | |
foreach( GameObject i in canvases){ | |
i.gameObject.SetActive(!i.gameObject.activeSelf); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment