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. Dismiss Notice

Force the editor to refresh in code. (Same as Ctrl-R)

Discussion in 'Scripting' started by landon912, Jun 18, 2014.

  1. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579
    Is there anyway I can call the editor to refresh exactly as the "Ctrl-R" method does while in the editor but from a script?

    I know it's short, but I can't really explain it any more. :p
     
  2. mushroomrisotto

    mushroomrisotto

    Joined:
    Dec 9, 2013
    Posts:
    24
  3. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
  4. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579
  5. gatewayadventuretravel

    gatewayadventuretravel

    Joined:
    Oct 7, 2021
    Posts:
    2
    so when I use Ctrl-R it works but with i use this method it stop my code and gives no errors


    Code (CSharp):
    1. public  void RefreshExample()
    2.         {
    3.             Debug.Log("RefreshExample()");
    4.             AssetDatabase.Refresh();
    5.      
    6.             InstatNewScene();
    7.         }
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,503
    Please don't necro-post to eight-year-old threads. Start your own... it's FREE!

    When you post, remember we cannot read your mind and most likely all the people from eight years ago are gone.

    That means you are required to communicate properly.

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/