Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

option for turning off editor animation

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

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    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

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    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;
    4.    
    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.     }
    17.  
     
    Last edited: Nov 23, 2017
    Peter77 likes this.