LightTab.ts 740 B

12345678910111213141516171819202122232425
  1. import { LightAdapter } from "../adapters/LightAdapter";
  2. import { Inspector } from "../Inspector";
  3. import { TreeItem } from "../tree/TreeItem";
  4. import { PropertyTab } from "./PropertyTab";
  5. import { TabBar } from "./TabBar";
  6. export class LightTab extends PropertyTab {
  7. constructor(tabbar: TabBar, inspector: Inspector) {
  8. super(tabbar, 'Light', inspector);
  9. }
  10. /* Overrides super */
  11. protected _getTree(): Array<TreeItem> {
  12. let arr = [];
  13. // get all lights from the first scene
  14. let instances = this._inspector.scene;
  15. for (let light of instances.lights) {
  16. arr.push(new TreeItem(this, new LightAdapter(light)));
  17. }
  18. return arr;
  19. }
  20. }