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.

How to Close EditorVR programmatically?

Discussion in 'EditorXR' started by anandapoudel1, Oct 27, 2018.

  1. anandapoudel1

    anandapoudel1

    Joined:
    Jan 30, 2017
    Posts:
    4
    I am wondering if I can close the EditorVR programmatically. This would be very helpful to the project I am doing. Any feedback is appreciated!
     
  2. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    400
    There isn't an explicit call, but you could search for the VRView window in active windows and/or directly reference it and close it:

    var view = VRView.activeView;
    if (view)
    view.Close();


    If you're needing to do this from a tool within EditorXR, then it's likely we'd want to expose this in an interface somehow.