protected void ImportBubble() { _projectid = _projectid.Trim(); if (string.IsNullOrEmpty(_projectid)) { EditorUtility.DisplayDialog("Unable to import", "Please specify a valid project name.", "Close"); return; } _scene = _scene.Trim(); if (string.IsNullOrEmpty(_scene)) { EditorUtility.DisplayDialog("Unable to import", "Please specify a valid project name.", "Close"); return; } _urn = _urn.Trim(); if (string.IsNullOrEmpty(_urn)) { EditorUtility.DisplayDialog("Unable to import", "Please specify a valid project URN.", "Close"); return; } _bearer = _bearer.Trim(); if (string.IsNullOrEmpty(_bearer)) { EditorUtility.DisplayDialog("Unable to import", "Please specify a valid access token.", "Close"); return; } if (this._saveToDisk) { string resources = ForgeConstants._resourcesPath + this._projectid; FileUtil.DeleteFileOrDirectory(resources); System.IO.Directory.CreateDirectory(resources); AssetDatabase.Refresh(); } _loader.PROJECTID = this._projectid; _loader.URN = this._urn; _loader.BEARER = this._bearer; _loader.SCENEID = this._scene; _loader.LoadMesh = this._loadMesh; _loader.CreateCollider = this._createColliders; _loader.LoadMetadata = this._loadMetadata; _loader.SaveToDisk = this._saveToDisk; _loader.ProcessedNodes += new ForgeLoaderEngine.ProcessedNodesDelegate(ProcessedNodes); _loader.ProcessingNodesCompleted += new ForgeLoaderEngine.ProcessingNodesCompletedDelegate(ProcessingNodesCompleted); _loaderActive = true; _loader.Awake(); }
// https://docs.unity3d.com/Manual/ExecutionOrder.html protected void Awake() // Awake is called before Start() { _loader.ROOT = gameObject; _loader.URN = this.URN; _loader.BEARER = this.BEARER; _loader.LoadMesh = this.LoadMesh; _loader.CreateCollider = this.CreateColliders; _loader.LoadMetadata = this.LoadMetadata; _loader.SCENEID = this.SCENEID; _loader.PROJECTID = this.SCENEID; _loader.SaveToDisk = false; _loader.ProcessedNodes += new ForgeLoaderEngine.ProcessedNodesDelegate(ProcessedNodesCB); _loader.ProcessingNodesCompleted += new ForgeLoaderEngine.ProcessingNodesCompletedDelegate(ProcessingNodesCompletedCB); _loader.Awake(); }