Browse Source

Merge pull request #63 from shaddockh/PerProjectExtUpdates

Per project ext updates
JoshEngebretson 9 years ago
parent
commit
07564a2f63

+ 7 - 0
EditorPluginExample/Resources/EditorData/Infobox.tb.txt

@@ -0,0 +1,7 @@
+TBLayout: axis: y, distribution: gravity, position: left
+	TBLayout:
+		TBTextField:  id: infobox_msg, text: ""
+			lp: min-width: 250
+	TBSeparator: gravity: left right, skin: AESeparator
+	TBLayout:
+		TBButton: text: Ok, id: infobox_ok

+ 5 - 0
EditorPluginExample/Resources/EditorData/Infobox.tb.txt.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "7500b687e7956e510de690bb119fc614",
+	"TextImporter": {}
+}

+ 146 - 0
EditorPluginExample/Resources/EditorData/JSExample.plugin.js

@@ -0,0 +1,146 @@
+var ExamplePluginUILabel = "JS Example Plugin";
+var ExamplePluginTBPath = "EditorData/Example.tb.txt";
+var InfoboxTBPath = "EditorData/Infobox.tb.txt";
+
+// Private variables
+var serviceLocator = null;
+var extensionWindow = null;
+var helloLabel = null;
+var nameField = null;
+var lastObjectName = null;
+
+// Private functions
+function getWidgets() {
+    if (!extensionWindow) {
+        return;
+    }
+
+    helloLabel = extensionWindow.getWidget("example_hello");
+    nameField = extensionWindow.getWidget("example_name");
+
+    if (lastObjectName) {
+        nameField.text = lastObjectName;
+        lastObjectName = null;
+    }
+}
+
+function handleWidgetEvent(ev) {
+    if (!extensionWindow) {
+        return;
+    }
+
+    if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
+        if (ev.target.id == "example_cancel") {
+            extensionWindow.hide();
+            extensionWindow = null;
+            return true;
+        }
+
+        if (ev.target.id == "example_speak") {
+            helloLabel.text = "Hello " + nameField.text;
+            return true;
+        }
+    }
+
+    return false;
+}
+
+function showInfobox(title, msg) {
+    var infobox = serviceLocator.uiServices.showModalWindow(
+        title, InfoboxTBPath,
+        function(ev) {
+            if (ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target.id == "infobox_ok") {
+                infobox.hide();
+                return true;
+            }
+        });
+    var msgLabel = infobox.getWidget("infobox_msg");
+    msgLabel.text = msg;
+}
+
+// Definition of the plugin
+var JSExamplePlugin = {
+    name: "JSExamplePlugin",
+    description: "This service demonstrates plugin functionality"
+};
+
+JSExamplePlugin.initialize = function(serviceLoader) {
+    console.log("JSExamplePluginService.initialize");
+
+    serviceLocator = serviceLoader;
+    if (serviceLocator) {
+        serviceLocator.projectServices.register(JSExamplePlugin);
+        serviceLocator.uiServices.register(JSExamplePlugin);
+    }
+};
+
+JSExamplePlugin.projectUnloaded = function() {
+    serviceLocator.uiServices.removeProjectContextMenuItemSource(ExamplePluginUILabel);
+    serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
+    serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
+
+    console.log("JSExamplePluginService.projectUnloaded");
+    if (serviceLocator) {
+        serviceLocator.projectServices.unregister(JSExamplePlugin);
+        serviceLocator.uiServices.unregister(JSExamplePlugin);
+    }
+};
+
+JSExamplePlugin.projectLoaded = function(ev) {
+    console.log("JSExamplePluginService.projectLoaded");
+    serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, {
+        "Open": ["jsexampleplugin open"]
+    });
+    serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, {
+        "Get name": ["jsexampleplugin hierarchy context"]
+    });
+    serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, {
+        "Get name": ["jsexampleplugin project context"]
+    });
+};
+
+JSExamplePlugin.playerStarted = function() {
+    console.log("JSExamplePluginService.playerStarted");
+};
+
+JSExamplePlugin.menuItemClicked = function(refId) {
+    console.log("JSExamplePluginService.menuItemClicked: " + refId);
+
+    if (refId == "jsexampleplugin open") {
+        extensionWindow = serviceLocator.uiServices.showModalWindow(
+            ExamplePluginUILabel, ExamplePluginTBPath, handleWidgetEvent);
+        getWidgets();
+        return true;
+    }
+
+    return false;
+};
+
+JSExamplePlugin.hierarchyContextItemClicked = function(node, refid) {
+    console.log("JSExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
+
+    if (refid == "jsexampleplugin hierarchy context") {
+        lastObjectName = "node " + node.name;
+
+        showInfobox("Hierarchy Item Selected ", "Node: '" + node.name + "' was selected.");
+        return true;
+    }
+
+    return false;
+}
+
+JSExamplePlugin.projectContextItemClicked = function(asset, refid) {
+    console.log("JSExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
+
+    if (refid == "jsexampleplugin project context") {
+        lastObjectName = "asset " + asset.name;
+
+        showInfobox("Project Item Selected ", "Asset: '" + asset.name + "' was selected.");
+        return true;
+    }
+
+    return false;
+}
+
+
+module.exports = JSExamplePlugin;

+ 1 - 1
EditorPluginExample/Resources/EditorData/Example.plugin.js.asset → EditorPluginExample/Resources/EditorData/JSExample.plugin.js.asset

@@ -1,6 +1,6 @@
 {
 {
 	"version": 1,
 	"version": 1,
-	"guid": "665b59fc3e7bd25a1a84d570adf55008",
+	"guid": "f2e4e2ea099058e4f68fbab37045b4c1",
 	"JavascriptImporter": {
 	"JavascriptImporter": {
 		"IsComponentFile": false
 		"IsComponentFile": false
 	}
 	}

+ 46 - 31
EditorPluginExample/Resources/EditorData/Example.plugin.js → EditorPluginExample/Resources/EditorData/TSExample.plugin.js

@@ -1,16 +1,19 @@
-var ExamplePluginUILabel = "Example Plugin";
+"use strict";
+var ExamplePluginUILabel = "TS Example Plugin";
 var ExamplePluginTBPath = "EditorData/Example.tb.txt";
 var ExamplePluginTBPath = "EditorData/Example.tb.txt";
-var ExamplePluginService = (function () {
-    function ExamplePluginService() {
+var InfoboxTBPath = "EditorData/Infobox.tb.txt";
+var TSExamplePluginService = (function () {
+    function TSExamplePluginService() {
         var _this = this;
         var _this = this;
-        this.name = "ExampleService";
+        this.name = "TSExampleService";
         this.description = "This service demonstrates plugin functionality functionality.";
         this.description = "This service demonstrates plugin functionality functionality.";
         this.serviceLocator = null;
         this.serviceLocator = null;
         this.extensionWindow = null;
         this.extensionWindow = null;
         this.lastObjectName = null;
         this.lastObjectName = null;
         this.handleWidgetEvent = function (ev) {
         this.handleWidgetEvent = function (ev) {
-            if (!_this.extensionWindow)
+            if (!_this.extensionWindow) {
                 return;
                 return;
+            }
             if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
             if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
                 if (ev.target.id == "example_cancel") {
                 if (ev.target.id == "example_cancel") {
                     _this.extensionWindow.hide();
                     _this.extensionWindow.hide();
@@ -25,61 +28,64 @@ var ExamplePluginService = (function () {
             return false;
             return false;
         };
         };
     }
     }
-    ExamplePluginService.prototype.initialize = function (serviceLoader) {
-        Atomic.print("ExamplePluginService.initialize");
+    TSExamplePluginService.prototype.initialize = function (serviceLoader) {
+        Atomic.print("TSExamplePluginService.initialize");
         this.serviceLocator = (serviceLoader);
         this.serviceLocator = (serviceLoader);
         if (this.serviceLocator) {
         if (this.serviceLocator) {
             this.serviceLocator.projectServices.register(this);
             this.serviceLocator.projectServices.register(this);
             this.serviceLocator.uiServices.register(this);
             this.serviceLocator.uiServices.register(this);
         }
         }
     };
     };
-    ExamplePluginService.prototype.projectUnloaded = function () {
+    TSExamplePluginService.prototype.projectUnloaded = function () {
         this.serviceLocator.uiServices.removeProjectContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeProjectContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
-        Atomic.print("ExamplePluginService.projectUnloaded");
+        Atomic.print("TSExamplePluginService.projectUnloaded");
         if (this.serviceLocator) {
         if (this.serviceLocator) {
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
         }
         }
     };
     };
-    ExamplePluginService.prototype.projectLoaded = function (ev) {
-        Atomic.print("ExamplePluginService.projectLoaded");
-        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open": ["exampleplugin open"] });
-        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["exampleplugin hierarchy context"] });
-        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["exampleplugin project context"] });
+    TSExamplePluginService.prototype.projectLoaded = function (ev) {
+        Atomic.print("TSExamplePluginService.projectLoaded");
+        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open": ["tsexampleplugin open"] });
+        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["tsexampleplugin hierarchy context"] });
+        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["tsexampleplugin project context"] });
     };
     };
-    ExamplePluginService.prototype.playerStarted = function () {
-        Atomic.print("ExamplePluginService.playerStarted");
+    TSExamplePluginService.prototype.playerStarted = function () {
+        Atomic.print("TSExamplePluginService.playerStarted");
     };
     };
-    ExamplePluginService.prototype.menuItemClicked = function (refId) {
-        Atomic.print("ExamplePluginService.menuItemClicked: " + refId);
-        if (refId == "exampleplugin open") {
+    TSExamplePluginService.prototype.menuItemClicked = function (refId) {
+        Atomic.print("TSExamplePluginService.menuItemClicked: " + refId);
+        if (refId == "tsexampleplugin open") {
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
             this.getWidgets();
             this.getWidgets();
             return true;
             return true;
         }
         }
         return false;
         return false;
     };
     };
-    ExamplePluginService.prototype.hierarchyContextItemClicked = function (node, refid) {
-        Atomic.print("ExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
-        if (refid == "exampleplugin hierarchy context") {
+    TSExamplePluginService.prototype.hierarchyContextItemClicked = function (node, refid) {
+        Atomic.print("TSExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
+        if (refid == "tsexampleplugin hierarchy context") {
             this.lastObjectName = "node " + node.name;
             this.lastObjectName = "node " + node.name;
+            this.showInfobox("Hierarchy Item Selected ", "Node: '" + node.name + "' was selected.");
             return true;
             return true;
         }
         }
         return false;
         return false;
     };
     };
-    ExamplePluginService.prototype.projectContextItemClicked = function (asset, refid) {
-        Atomic.print("ExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
-        if (refid == "exampleplugin project context") {
+    TSExamplePluginService.prototype.projectContextItemClicked = function (asset, refid) {
+        Atomic.print("TSExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
+        if (refid == "tsexampleplugin project context") {
             this.lastObjectName = "asset " + asset.name;
             this.lastObjectName = "asset " + asset.name;
+            this.showInfobox("Project Asset Selected", "Asset: '" + asset.name + "' was selected.");
             return true;
             return true;
         }
         }
         return false;
         return false;
     };
     };
-    ExamplePluginService.prototype.getWidgets = function () {
-        if (!this.extensionWindow)
+    TSExamplePluginService.prototype.getWidgets = function () {
+        if (!this.extensionWindow) {
             return;
             return;
+        }
         this.helloLabel = this.extensionWindow.getWidget("example_hello");
         this.helloLabel = this.extensionWindow.getWidget("example_hello");
         this.nameField = this.extensionWindow.getWidget("example_name");
         this.nameField = this.extensionWindow.getWidget("example_name");
         if (this.lastObjectName) {
         if (this.lastObjectName) {
@@ -87,8 +93,17 @@ var ExamplePluginService = (function () {
             this.lastObjectName = null;
             this.lastObjectName = null;
         }
         }
     };
     };
-    return ExamplePluginService;
-})();
-var examplePluginService = new ExamplePluginService();
+    TSExamplePluginService.prototype.showInfobox = function (title, msg) {
+        var infobox = this.serviceLocator.uiServices.showModalWindow(title, InfoboxTBPath, function (ev) {
+            if (ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target.id == "infobox_ok") {
+                infobox.hide();
+                return true;
+            }
+        });
+        var msgLabel = infobox.getWidget("infobox_msg");
+        msgLabel.text = msg;
+    };
+    return TSExamplePluginService;
+}());
 Object.defineProperty(exports, "__esModule", { value: true });
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.default = examplePluginService;
+exports.default = new TSExamplePluginService();

+ 7 - 0
EditorPluginExample/Resources/EditorData/TSExample.plugin.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "6b7a00860900ce07eafd89703f8dca1a",
+	"JavascriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 40 - 23
EditorPluginExample/Resources/EditorData/Example.plugin.ts → EditorPluginExample/Resources/EditorData/TSExample.plugin.ts

@@ -1,12 +1,13 @@
 /// <reference path="../../typings/Atomic/AtomicWork.d.ts" />
 /// <reference path="../../typings/Atomic/AtomicWork.d.ts" />
 /// <reference path="../../typings/Atomic/EditorWork.d.ts" />
 /// <reference path="../../typings/Atomic/EditorWork.d.ts" />
 
 
-const ExamplePluginUILabel = "Example Plugin";
+const ExamplePluginUILabel = "TS Example Plugin";
 const ExamplePluginTBPath = "EditorData/Example.tb.txt";
 const ExamplePluginTBPath = "EditorData/Example.tb.txt";
+const InfoboxTBPath = "EditorData/Infobox.tb.txt";
 
 
-class ExamplePluginService implements Editor.HostExtensions.HostEditorService, Editor.HostExtensions.ProjectServicesEventListener, Editor.HostExtensions.UIServicesEventListener {
+class TSExamplePluginService implements Editor.HostExtensions.HostEditorService, Editor.HostExtensions.ProjectServicesEventListener, Editor.HostExtensions.UIServicesEventListener {
 
 
-    name: string = "ExampleService";
+    name: string = "TSExampleService";
     description: string = "This service demonstrates plugin functionality functionality.";
     description: string = "This service demonstrates plugin functionality functionality.";
 
 
     private serviceLocator: Editor.HostExtensions.HostServiceLocator = null;
     private serviceLocator: Editor.HostExtensions.HostServiceLocator = null;
@@ -18,7 +19,7 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     private lastObjectName: string = null;
     private lastObjectName: string = null;
 
 
     initialize(serviceLoader: Editor.HostExtensions.HostServiceLocator) {
     initialize(serviceLoader: Editor.HostExtensions.HostServiceLocator) {
-        Atomic.print("ExamplePluginService.initialize");
+        Atomic.print("TSExamplePluginService.initialize");
 
 
         this.serviceLocator = (serviceLoader);
         this.serviceLocator = (serviceLoader);
         if (this.serviceLocator) {
         if (this.serviceLocator) {
@@ -31,26 +32,26 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
 
 
-        Atomic.print("ExamplePluginService.projectUnloaded");
+        Atomic.print("TSExamplePluginService.projectUnloaded");
         if (this.serviceLocator) {
         if (this.serviceLocator) {
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
         }
         }
     }
     }
     projectLoaded(ev: Editor.EditorEvents.LoadProjectEvent) {
     projectLoaded(ev: Editor.EditorEvents.LoadProjectEvent) {
-        Atomic.print("ExamplePluginService.projectLoaded");
-        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open" : ["exampleplugin open"] });
-        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["exampleplugin hierarchy context"]});
-        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["exampleplugin project context"]});
+        Atomic.print("TSExamplePluginService.projectLoaded");
+        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open" : ["tsexampleplugin open"] });
+        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["tsexampleplugin hierarchy context"]});
+        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["tsexampleplugin project context"]});
     }
     }
     playerStarted() {
     playerStarted() {
-        Atomic.print("ExamplePluginService.playerStarted");
+        Atomic.print("TSExamplePluginService.playerStarted");
     }
     }
 
 
     menuItemClicked(refId: string): boolean {
     menuItemClicked(refId: string): boolean {
-        Atomic.print("ExamplePluginService.menuItemClicked: " + refId);
-        
-        if (refId == "exampleplugin open") {
+        Atomic.print("TSExamplePluginService.menuItemClicked: " + refId);
+
+        if (refId == "tsexampleplugin open") {
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(
                 ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
                 ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
             this.getWidgets();
             this.getWidgets();
@@ -61,11 +62,12 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     }
     }
 
 
     hierarchyContextItemClicked(node: Atomic.Node, refid: string): boolean {
     hierarchyContextItemClicked(node: Atomic.Node, refid: string): boolean {
-        Atomic.print("ExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
+        Atomic.print("TSExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
 
 
-        if (refid == "exampleplugin hierarchy context") {
+        if (refid == "tsexampleplugin hierarchy context") {
             this.lastObjectName = "node " + node.name;
             this.lastObjectName = "node " + node.name;
 
 
+            this.showInfobox("Hierarchy Item Selected ", `Node: '${node.name}' was selected.`);
             return true;
             return true;
         }
         }
 
 
@@ -73,11 +75,11 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     }
     }
 
 
     projectContextItemClicked(asset: ToolCore.Asset, refid: string): boolean {
     projectContextItemClicked(asset: ToolCore.Asset, refid: string): boolean {
-        Atomic.print("ExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
+        Atomic.print("TSExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
 
 
-        if (refid == "exampleplugin project context") {
+        if (refid == "tsexampleplugin project context") {
             this.lastObjectName = "asset " + asset.name;
             this.lastObjectName = "asset " + asset.name;
-
+            this.showInfobox("Project Asset Selected", `Asset: '${asset.name}' was selected.`);
             return true;
             return true;
         }
         }
 
 
@@ -85,8 +87,9 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     }
     }
 
 
     getWidgets() {
     getWidgets() {
-        if (!this.extensionWindow)
+        if (!this.extensionWindow) {
             return;
             return;
+        }
 
 
         this.helloLabel = <Atomic.UITextField>this.extensionWindow.getWidget("example_hello");
         this.helloLabel = <Atomic.UITextField>this.extensionWindow.getWidget("example_hello");
         this.nameField = <Atomic.UIEditField>this.extensionWindow.getWidget("example_name");
         this.nameField = <Atomic.UIEditField>this.extensionWindow.getWidget("example_name");
@@ -97,9 +100,22 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
         }
         }
     }
     }
 
 
+    showInfobox(title: string, msg: string) {
+        const infobox = this.serviceLocator.uiServices.showModalWindow(
+            title, InfoboxTBPath, (ev: Atomic.UIWidgetEvent) => {
+                if (ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target.id == "infobox_ok") {
+                    infobox.hide();
+                    return true;
+                }
+            });
+        const msgLabel = <Atomic.UITextField>infobox.getWidget("infobox_msg");
+        msgLabel.text = msg;
+    }
+
     handleWidgetEvent = (ev: Atomic.UIWidgetEvent): boolean => { // => notation used to bind "this" to the method
     handleWidgetEvent = (ev: Atomic.UIWidgetEvent): boolean => { // => notation used to bind "this" to the method
-        if (!this.extensionWindow)
+        if (!this.extensionWindow) {
             return;
             return;
+        }
 
 
         if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
         if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
 
 
@@ -115,12 +131,13 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
 
 
                 return true;
                 return true;
             }
             }
+
         }
         }
 
 
         return false;
         return false;
 
 
-    }
+    };
+
 }
 }
 
 
-const examplePluginService = new ExamplePluginService();
-export default examplePluginService;
+export default new TSExamplePluginService();

+ 1 - 1
EditorPluginExample/Resources/EditorData/Example.plugin.ts.asset → EditorPluginExample/Resources/EditorData/TSExample.plugin.ts.asset

@@ -1,6 +1,6 @@
 {
 {
 	"version": 1,
 	"version": 1,
-	"guid": "1ee4c60ac3a41be878f1d1f2921b6ad8",
+	"guid": "0433a3791e5b64b50a98b4a4d3406bdb",
 	"TypeScriptImporter": {
 	"TypeScriptImporter": {
 		"IsComponentFile": false
 		"IsComponentFile": false
 	}
 	}

+ 1 - 1
EditorPluginExample/Resources/EditorData/tsconfig.json

@@ -12,6 +12,6 @@
         "experimentalDecorators": true
         "experimentalDecorators": true
     },
     },
     "files": [
     "files": [
-        "./Example.plugin.ts"
+        "./TSExample.plugin.ts"
     ]
     ]
 }
 }

+ 5 - 0
EditorPluginExample/Resources/Scenes.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "0820b61fc0ee9df2ca7c0317f52fc353",
+	"FolderImporter": {}
+}

+ 58 - 0
EditorPluginExample/Resources/Scenes/Scene.scene

@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<scene id="1">
+	<attribute name="Name" value="" />
+	<attribute name="Time Scale" value="1" />
+	<attribute name="Smoothing Constant" value="50" />
+	<attribute name="Snap Threshold" value="5" />
+	<attribute name="Elapsed Time" value="0" />
+	<attribute name="Next Replicated Node ID" value="362" />
+	<attribute name="Next Replicated Component ID" value="1974" />
+	<attribute name="Next Local Node ID" value="16778496" />
+	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Variables" />
+	<attribute name="Variable Names" value="" />
+	<component type="PhysicsWorld" id="1" />
+	<component type="Octree" id="2" />
+	<component type="DebugRenderer" id="3" />
+	<node id="2">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Zone" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Zone" id="4">
+			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
+			<attribute name="Bounding Box Max" value="10000 10000 10000" />
+			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
+		</component>
+	</node>
+	<node id="3">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="GlobalLight" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="0.888074 0.325058 -0.325058 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Light" id="5">
+			<attribute name="Light Type" value="Directional" />
+			<attribute name="Cast Shadows" value="true" />
+			<attribute name="CSM Splits" value="10 20 50 0" />
+			<attribute name="View Size Quantize" value="1" />
+			<attribute name="View Size Minimum" value="5" />
+			<attribute name="Depth Constant Bias" value="0.00025" />
+			<attribute name="Depth Slope Bias" value="0.001" />
+		</component>
+	</node>
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Camera" />
+		<attribute name="Position" value="0 0 -5" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Camera" id="1973">
+			<attribute name="FOV" value="45" />
+		</component>
+	</node>
+</scene>

+ 8 - 0
EditorPluginExample/Resources/Scenes/Scene.scene.asset

@@ -0,0 +1,8 @@
+{
+	"version": 1,
+	"guid": "3c6bb8505409cacde83747b9a2151239",
+	"SceneImporter": {
+		"sceneCamRotation": "1 0 0 0",
+		"sceneCamPosition": "0 0 0"
+	}
+}

+ 0 - 2
tslint.json

@@ -23,9 +23,7 @@
     "no-duplicate-variable": true,
     "no-duplicate-variable": true,
     "no-empty": false,
     "no-empty": false,
     "no-eval": true,
     "no-eval": true,
-    "no-imports": true,
     "no-string-literal": false,
     "no-string-literal": false,
-    "no-trailing-comma": true,
     "no-trailing-whitespace": true,
     "no-trailing-whitespace": true,
     "no-unused-variable": false,
     "no-unused-variable": false,
     "no-unreachable": true,
     "no-unreachable": true,