Closed strawberry3269 closed 3 years ago
出现lottie播放的场景
import { Game, GameObject, resource } from '@eva/eva.js' import { RendererSystem } from '@eva/plugin-renderer' import { LottieSystem, Lottie } from '@eva/plugin-renderer-lottie'
const game = new Game({ systems: [ new RendererSystem({ canvas: document.querySelector('#canvas'), width: 750, height: 1624 }), new LottieSystem() ], autoStart: true, frameRate: 60 })
resource.addResource([ { name: 'ResourceName', type: 'LOTTIE', src: { json: { type: 'json', url: 'https://gw.alipayobjects.com/os/bmw-prod/61d9cc77-12de-47a7-b6e5-06c836ce7083.json' } } } ])
const LottieComponent = new Lottie({ resource: 'ResourceName' }) const LottieGameObject = new GameObject('ResourceName', {})
LottieGameObject.addComponent(LottieComponent) game.scene.addChild(LottieGameObject)
Eva.js
https://github.com/eva-engine/eva-engine.github.io/commit/ee96dad627b1bdfa7ffcfd65b75f160d9aed7b7f
Expected Behavior
出现lottie播放的场景
Current Behavior
Possible Solution
Steps to Reproduce
Environment
import { Game, GameObject, resource } from '@eva/eva.js' import { RendererSystem } from '@eva/plugin-renderer' import { LottieSystem, Lottie } from '@eva/plugin-renderer-lottie'
const game = new Game({ systems: [ new RendererSystem({ canvas: document.querySelector('#canvas'), width: 750, height: 1624 }), new LottieSystem() ], autoStart: true, frameRate: 60 })
resource.addResource([ { name: 'ResourceName', type: 'LOTTIE', src: { json: { type: 'json', url: 'https://gw.alipayobjects.com/os/bmw-prod/61d9cc77-12de-47a7-b6e5-06c836ce7083.json' } } } ])
const LottieComponent = new Lottie({ resource: 'ResourceName' }) const LottieGameObject = new GameObject('ResourceName', {})
LottieGameObject.addComponent(LottieComponent) game.scene.addChild(LottieGameObject)
Eva.js
version: e.g. 1.0.0