Example #1
0
    /// <summary>
    /// Opens a file in the editor.
    /// </summary>
    /// <param name="file">File.</param>
    public static void OpenFile(string file)
    {
        WebEditorWindow window = (WebEditorWindow)WebEditorWindow.GetWindow(typeof(WebEditorWindow));

        window.OpenFileByHash(file);
        window.Init();
        window.CreateContextObject();
        window.Show();
        window.titleContent = new GUIContent("Vubbi Code Editor"); window.Focus();
    }
Example #2
0
        /// <summary>
        /// Opens the Vubbi asset file in the editor.
        /// </summary>
        /// <param name="file">File. WITHOUT Asset/ WITHOUT extension</param>
        public static void OpenFile(string file)
        {
            bool OPENINBROWSER = true;

            if (OPENINBROWSER)
            {
                Application.OpenURL("http://localhost:8040/#" + file);
            }
            else
            {
                // DID NOT WORK SO WELL - still here in case we decide to use it again...
                // (Difficult to minimize and the window loses data when you start/stop a game)
                WebEditorWindow.OpenFile(file);
            }
        }