UNPKG

wonder.js

Version:
58 lines (48 loc) 3.18 kB
'use strict'; var Caml_array = require("bs-platform/lib/js/caml_array.js"); var ComponentMapService$Wonderjs = require("../../../primitive/gameObject/ComponentMapService.js"); var RemoveGeometryMainService$Wonderjs = require("../geometry/RemoveGeometryMainService.js"); var RemoveBasicMaterialMainService$Wonderjs = require("../material/basic/RemoveBasicMaterialMainService.js"); var RemoveLightMaterialMainService$Wonderjs = require("../material/light/RemoveLightMaterialMainService.js"); var _removeComponent = ComponentMapService$Wonderjs.removeComponent; function removeGeometryComponent(uid, component, state) { var gameObjectRecord = state[/* gameObjectRecord */10]; var newrecord = Caml_array.caml_array_dup(state); var newrecord$1 = Caml_array.caml_array_dup(gameObjectRecord); newrecord$1[/* geometryMap */29] = ComponentMapService$Wonderjs.removeComponent(uid, gameObjectRecord[/* geometryMap */29]); newrecord[/* gameObjectRecord */10] = newrecord$1; return RemoveGeometryMainService$Wonderjs.handleRemoveComponent(uid, component, newrecord); } function batchRemoveGeometryComponent(state, geometryDataMap) { return RemoveGeometryMainService$Wonderjs.handleBatchRemoveComponent(geometryDataMap, state); } function removeBasicMaterialComponent(uid, component, state) { var gameObjectRecord = state[/* gameObjectRecord */10]; var newrecord = Caml_array.caml_array_dup(state); var newrecord$1 = Caml_array.caml_array_dup(gameObjectRecord); newrecord$1[/* basicMaterialMap */36] = ComponentMapService$Wonderjs.removeComponent(uid, gameObjectRecord[/* basicMaterialMap */36]); newrecord[/* gameObjectRecord */10] = newrecord$1; return RemoveBasicMaterialMainService$Wonderjs.handleRemoveComponent(uid, component, newrecord); } function batchRemoveBasicMaterialComponent(state, basicMaterialDataMap) { return RemoveBasicMaterialMainService$Wonderjs.handleBatchRemoveComponent(basicMaterialDataMap, state); } function removeLightMaterialComponent(uid, component, state) { var gameObjectRecord = state[/* gameObjectRecord */10]; var newrecord = Caml_array.caml_array_dup(state); var newrecord$1 = Caml_array.caml_array_dup(gameObjectRecord); newrecord$1[/* lightMaterialMap */37] = ComponentMapService$Wonderjs.removeComponent(uid, gameObjectRecord[/* lightMaterialMap */37]); newrecord[/* gameObjectRecord */10] = newrecord$1; return RemoveLightMaterialMainService$Wonderjs.handleRemoveComponent(uid, component, newrecord); } function batchRemoveLightMaterialComponent(state, lightMaterialDataMap) { return RemoveLightMaterialMainService$Wonderjs.handleBatchRemoveComponent(lightMaterialDataMap, state); } exports._removeComponent = _removeComponent; exports.removeGeometryComponent = removeGeometryComponent; exports.batchRemoveGeometryComponent = batchRemoveGeometryComponent; exports.removeBasicMaterialComponent = removeBasicMaterialComponent; exports.batchRemoveBasicMaterialComponent = batchRemoveBasicMaterialComponent; exports.removeLightMaterialComponent = removeLightMaterialComponent; exports.batchRemoveLightMaterialComponent = batchRemoveLightMaterialComponent; /* ComponentMapService-Wonderjs Not a pure module */