Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lottie 销毁逻辑 #92

Open
cptbtptpbcptdtptp opened this issue Nov 2, 2023 · 2 comments
Open

Lottie 销毁逻辑 #92

cptbtptpbcptdtptp opened this issue Nov 2, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@cptbtptpbcptdtptp
Copy link
Collaborator

类似 galacean/engine#1831 这条 PR,开发者需要如何销毁 Lottie 的资源?

@cptbtptpbcptdtptp
Copy link
Collaborator Author

cptbtptpbcptdtptp commented Nov 2, 2023

重构 glTF 引用计数的那个 PR 大致做了以下工作:

  1. 将 glTF 原本克隆根节点的操作作为类方法( instantiateSceneRoot )方便使用,并且保证原始节点不直接被生产环境使用
  2. 所有 glTF 解析得到的原始节点都加上模版标记(_isTemplate),这个标记会忽略引用计数,即场上只剩下原始节点时,引用的资产引用计数依旧是 0。
  3. 在场上有使用 gltf.instantiateSceneRoot 的实例或者其子节点的克隆时,非强制不能回收局部资源,保证模型正常显示
  4. 在场上没有使用 gltf.instantiateSceneRoot 的实例或者其子节点的克隆时,可以清理局部资源的引用

@cptbtptpbcptdtptp
Copy link
Collaborator Author

Lottie 的使用场景会简单一些,这块定下来我可以依照 @GuoLei1990 对复合型资产的设计进行实现。

@cptbtptpbcptdtptp cptbtptpbcptdtptp self-assigned this Nov 2, 2023
@cptbtptpbcptdtptp cptbtptpbcptdtptp added the enhancement New feature or request label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant