Skip to content

Instantly share code, notes, and snippets.

@Democide
Last active October 23, 2021 12:04
Show Gist options
  • Save Democide/aa9654d742394f2920beaa94cece3cbd to your computer and use it in GitHub Desktop.
Save Democide/aa9654d742394f2920beaa94cece3cbd to your computer and use it in GitHub Desktop.

Revisions

  1. Democide revised this gist Aug 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ShortcutToggleObjectActivation.cs
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    public static class ShortcutToggleObjectActivation
    {
    // ALT + SHIFT + A to toggle active state of selected GameObjects
    // LEFT ALT + LEFT SHIFT + A to toggle active state of selected GameObjects
    [MenuItem("Shortcuts/Toggle Selected GameObjects Active #&a")]
    static void SaveGameOpenFolder()
    {
  2. Democide revised this gist Aug 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ShortcutToggleObjectActivation.cs
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    public static class ShortcutToggleObjectActivation
    {
    // ALT + L-SHIFT + A to toggle active state of selected GameObjects
    // ALT + SHIFT + A to toggle active state of selected GameObjects
    [MenuItem("Shortcuts/Toggle Selected GameObjects Active #&a")]
    static void SaveGameOpenFolder()
    {
  3. Democide revised this gist Aug 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ShortcutToggleObjectActivation.cs
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    public static class ShortcutToggleObjectActivation
    {
    // CTRL + L-SHIFT + A to toggle active state of selected GameObjects
    // ALT + L-SHIFT + A to toggle active state of selected GameObjects
    [MenuItem("Shortcuts/Toggle Selected GameObjects Active #&a")]
    static void SaveGameOpenFolder()
    {
  4. Democide revised this gist Aug 25, 2017. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions ShortcutToggleObjectActivation.cs
    Original file line number Diff line number Diff line change
    @@ -4,15 +4,16 @@

    public static class ShortcutToggleObjectActivation
    {
    // CTRL + L-SHIFT + A to toggle active state of selected GameObjects
    [MenuItem("Shortcuts/Toggle Selected GameObjects Active #&a")]
    static void SaveGameOpenFolder()
    {
    if (Selection.gameObjects.Length > 1) {
    foreach (var item in Selection.gameObjects) {
    item.SetActive(!item.activeSelf);
    if (Selection.gameObjects.Length > 1) {
    foreach (var item in Selection.gameObjects) {
    item.SetActive(!item.activeSelf);
    }
    }
    else if (Selection.activeGameObject != null) {
    else if (Selection.activeGameObject != null) {
    Selection.activeGameObject.SetActive(!Selection.activeGameObject.activeSelf);
    }
    }
  5. Democide created this gist Aug 25, 2017.
    19 changes: 19 additions & 0 deletions ShortcutToggleObjectActivation.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    using UnityEngine;
    using System.Collections;
    using UnityEditor;

    public static class ShortcutToggleObjectActivation
    {
    [MenuItem("Shortcuts/Toggle Selected GameObjects Active #&a")]
    static void SaveGameOpenFolder()
    {
    if (Selection.gameObjects.Length > 1) {
    foreach (var item in Selection.gameObjects) {
    item.SetActive(!item.activeSelf);
    }
    }
    else if (Selection.activeGameObject != null) {
    Selection.activeGameObject.SetActive(!Selection.activeGameObject.activeSelf);
    }
    }
    }