當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript observable.Observable類代碼示例

本文整理匯總了TypeScript中babylonjs/Misc/observable.Observable的典型用法代碼示例。如果您正苦於以下問題:TypeScript Observable類的具體用法?TypeScript Observable怎麽用?TypeScript Observable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Observable類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: dispose

    /**
     * dispose the manager and all of its associated viewers
     */
    public dispose() {
        delete this._onViewerAdded;

        for (let id in this._viewers) {
            this._viewers[id].dispose();
        }

        this.onViewerAddedObservable.clear();
        this.onViewerRemovedObservable.clear();
    }
開發者ID:BabylonJS,項目名稱:Babylon.js,代碼行數:13,代碼來源:viewerManager.ts

示例2: Promise

 return new Promise((resolve, reject) => {
     let localViewer = this.getViewerById(id);
     if (localViewer) {
         return resolve(localViewer);
     }
     let viewerFunction = (viewer: AbstractViewer) => {
         if (viewer.getBaseId() === id) {
             resolve(viewer);
             this.onViewerAddedObservable.removeCallback(viewerFunction);
         }
     };
     this.onViewerAddedObservable.add(viewerFunction);
 });
開發者ID:BabylonJS,項目名稱:Babylon.js,代碼行數:13,代碼來源:viewerManager.ts

示例3: dispose

 dispose() {
     this.onSceneInitObservable.clear();
     this.onEngineInitObservable.clear();
     this.onModelLoadedObservable.clear();
     this.onModelLoadProgressObservable.clear();
     this.onModelLoadErrorObservable.clear();
     this.onModelAddedObservable.clear();
     this.onModelRemovedObservable.clear();
     this.onViewerInitDoneObservable.clear();
     this.onLoaderInitObservable.clear();
     this.onFrameRenderedObservable.clear();
     this.onEnteringVRObservable.clear();
     this.onExitingVRObservable.clear();
 }
開發者ID:BabylonJS,項目名稱:Babylon.js,代碼行數:14,代碼來源:observablesManager.ts

示例4: _onViewerAdded

 private _onViewerAdded(viewer: AbstractViewer) {
     this.onViewerAdded && this.onViewerAdded(viewer);
     this.onViewerAddedObservable.notifyObservers(viewer);
 }
開發者ID:BabylonJS,項目名稱:Babylon.js,代碼行數:4,代碼來源:viewerManager.ts

示例5: resolve

 let viewerFunction = (viewer: AbstractViewer) => {
     if (viewer.getBaseId() === id) {
         resolve(viewer);
         this.onViewerAddedObservable.removeCallback(viewerFunction);
     }
 };
開發者ID:BabylonJS,項目名稱:Babylon.js,代碼行數:6,代碼來源:viewerManager.ts

示例6: removeViewer

 /**
  * remove a viewer from the viewer manager
  * @param viewer the viewer to remove
  */
 public removeViewer(viewer: AbstractViewer) {
     let id = viewer.getBaseId();
     delete this._viewers[id];
     this.onViewerRemovedObservable.notifyObservers(id);
 }
開發者ID:BabylonJS,項目名稱:Babylon.js,代碼行數:9,代碼來源:viewerManager.ts


注:本文中的babylonjs/Misc/observable.Observable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。