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

编辑器相关需求 #181

Closed
fanmingfei opened this issue Dec 29, 2021 · 3 comments · May be fixed by #182
Closed

编辑器相关需求 #181

fanmingfei opened this issue Dec 29, 2021 · 3 comments · May be fixed by #182

Comments

@fanmingfei
Copy link
Member

No description provided.

@fanmingfei
Copy link
Member Author

fanmingfei commented Dec 29, 2021

添加游戏对象到指定的位置

// go是父gameObject指定index
go.addChildAt(child, index)

如果想放在某个gameObject后面的话 可以先获取他的位置

// target 是目标gameObject

// go是父gameObject

// child 是要添加的gameObject

// 获取index
const index = go.transform.children.indexOf(target.transform)

go.addChildAt(index) // 插入到target的位置,target以及后面的会向后平移

go.addChildAt(index+1) // 插入到target的后面

Commit: 5ce44c7

@fanmingfei
Copy link
Member Author

Transform中提供获取 Local Transform 和 Global Transform 的方案。

@fanmingfei fanmingfei linked a pull request Jan 5, 2022 that will close this issue
3 tasks
@ChinDer
Copy link

ChinDer commented Jan 21, 2022

const { data } = await resource.getResource(rn); const json = { ...(data.json || {}) }; const assets = json.assets || [];
LottieSystem add的时候。 resource.getResource(rn);可能为空 会导致data.json报错 需要兼容

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants