Quellcode durchsuchen

3dModeling UIAnchor.js 李欣儒 commit at 2021-04-26

李欣儒 vor 4 Jahren
Ursprung
Commit
8e48bf9bb2
1 geänderte Dateien mit 33 neuen und 0 gelöschten Zeilen
  1. 33 0
      3dModeling/zyl284/UIAnchor.js

+ 33 - 0
3dModeling/zyl284/UIAnchor.js

@@ -159,3 +159,36 @@ function create_ui(deviceType, floorNum, deviceList) {
     }else{
         num = 'F' + floorNum;
     }
+    var carList = app.query("#" + num)[0].query(deviceType)
+    var carList1 = app.query("#" + num)[0]
+    console.log(carList)
+    console.log(deviceIcon.length)
+    //   app.query("#" + id)[0].query('.Thing').forEach(function (obj){
+    //     var car = app.query("#"+obj.id)[0];
+    //     panelArr.push(uiAnchor(car));
+    // })
+    for (var i = 0; i < deviceIcon.length; i++) {
+        dName = deviceIcon[i].device_name;
+        var ownercode = deviceIcon[i].owner_code
+        console.log(dName,ownercode,carList[i])
+        ui = app.create({
+            type: 'UIAnchor',
+            parent: carList[i],
+            element: create_element(dName, deviceTypes, floorNum, ownercode),
+            localPosition: [0, 2, 0],
+            pivot: [0.5, 1] //  [0,0]即以界面左上角定位,[1,1]即以界面右下角进行定位
+        });
+        uis.push(ui);
+    }
+
+}
+// 删除界面
+function destroy_ui() {
+    if (uis) {
+        for (var i = 0; i < uis.length; i++) {
+            uis[i].destroy();
+        }
+        uis = [];
+    }
+
+}