-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pass run test:redo/undo when run
fix clone with parent->redo; fix add glb->redo;
- Loading branch information
Showing
11 changed files
with
44 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,11 @@ | ||
import { state as meta3dState } from "meta3d-type" | ||
import { gameObject } from "meta3d-gameobject-protocol" | ||
import { service as engineWholeService } from "meta3d-engine-whole-sceneview-protocol/src/service/ServiceType" | ||
import { getExn, isNullable } from "meta3d-commonlib-ts/src/NullableUtils" | ||
|
||
export let disposeGameObjectAndChildren =<engineWholeService_ extends engineWholeService> (meta3dState: meta3dState, | ||
export let disposeGameObjectAndAllChildren = <engineWholeService_ extends engineWholeService>(meta3dState: meta3dState, | ||
engineWholeService: engineWholeService_, | ||
gameObject: gameObject): meta3dState => { | ||
let { getChildren, getGameObjects } = engineWholeService.scene.transform | ||
let { getTransform, disposeGameObjects } = engineWholeService.scene.gameObject | ||
let { disposeGameObjects, getGameObjectAndAllChildren } = engineWholeService.scene.gameObject | ||
|
||
let _getGameObjects = (result: Array<gameObject>, meta3dState: meta3dState, gameObject: gameObject): Array<gameObject> => { | ||
let children = getChildren(meta3dState, getTransform(meta3dState, gameObject)) | ||
|
||
if (isNullable(children) || getExn(children).length == 0) { | ||
return result | ||
} | ||
|
||
return getExn(children).reduce((result, child) => { | ||
let gameObject = getGameObjects(meta3dState, child)[0] | ||
|
||
result.push( | ||
gameObject | ||
) | ||
|
||
return _getGameObjects(result, meta3dState, gameObject) | ||
}, result) | ||
} | ||
|
||
return disposeGameObjects(meta3dState, _getGameObjects([gameObject], meta3dState, gameObject)) | ||
return disposeGameObjects(meta3dState, getGameObjectAndAllChildren(meta3dState, gameObject)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters