Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Apply button in Inspector?

Discussion in 'Scripting' started by lowpolygon, Sep 4, 2012.

  1. lowpolygon

    lowpolygon

    Joined:
    May 5, 2012
    Posts:
    60
    Hi all..
    Is there any way I can access the Apply button on top right corner of the inspector using script ?


    Note: Never Mind, I found a way to do it.

    Code (csharp):
    1. EditorApplication.ExecuteMenuItem("GameObject/Apply Changes To Prefab");
    did the trick.
     
    Last edited: Sep 4, 2012
  2. RazorCut

    RazorCut

    Joined:
    May 7, 2009
    Posts:
    393
    Omg, nice! I never knew you could do that!
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You can also use the PrefabUtility class for example to manage prefabs