Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

option for turning off editor animation

Discussion in '2017.3 Beta' started by laurentlavigne, Nov 23, 2017.

  1. laurentlavigne


    Aug 16, 2012
    In another beta thread one of the dev gave us an editor script to toggle off editor tree animation and since I installed a new machine and lost that script, it's a good moment to remind you guys to officially add a turn off animation in the option window.
  2. laurentlavigne


    Aug 16, 2012
    By the time windows search finishes, I had the time to find Mads' script. Here it is for those who need a stop gap.

    Code (CSharp):
    1.     using UnityEditor;
    2.     using UnityEditorInternal;
    3.     using UnityEngine;
    5.     static class TreeViewUtils
    6.     {
    7.         [MenuItem("TreeViewUtility/Toggle Animation")]
    8.         static void ToggleAnimation()
    9.         {
    10.             const string prefKey = "TreeViewExpansionAnimation";
    11.             bool newValue = !EditorPrefs.GetBool(prefKey, true);
    12.             EditorPrefs.SetBool(prefKey, newValue);
    13.             InternalEditorUtility.RequestScriptReload();
    14.             Debug.Log("TreeView animation is now " + (newValue ? "enabled" : "disabled"));
    15.         }
    16.     }
    Last edited: Nov 23, 2017
    Peter77 likes this.