Search Unity

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