@galacean/effects-threejs 2.0.0-alpha.33 → 2.0.0-alpha.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -72,4 +72,24 @@ function render () {
72
72
  render();
73
73
  ```
74
74
 
75
+ ## Event System
76
+
77
+ The event system of ThreeDisplayObject is inherited from THREE.js, and events are triggered in the form of dispatch. Refer to the code below:
78
+
79
+ ```ts
80
+ import { ThreeDisplayObject } from '@galacean/effects-threejs';
81
+
82
+ const displayObject = new ThreeDisplayObject(renderer.getContext(), { width, height });
83
+ // Load Galacean Effects product
84
+ const composition = await displayObject.loadScene('./xxx.json');
85
+ // Add the drawing object to the THREE scene
86
+ scene.add(displayObject);
87
+
88
+ // Using the end event as an example, refer to the above links for other events
89
+ displayObject.addEventListener('end', () => {
90
+ // Example code
91
+ console.info('composition is end');
92
+ });
93
+ ```
94
+
75
95
  ## [API Documentation](https://galacean.antgroup.com/effects/#/api/modules_galacean_effects_threejs)