Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

    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.