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

新建图表无法使用前期导出的Theme #148

Closed
Bian-Sh opened this issue May 19, 2021 · 6 comments
Closed

新建图表无法使用前期导出的Theme #148

Bian-Sh opened this issue May 19, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Bian-Sh
Copy link
Contributor

Bian-Sh commented May 19, 2021

image
如图所示,在设置页面指定了导出的主题文件,但是新建的图表的 Theme 模块没有这些主题的选项。
只有修改并导出自定义主题,这个自定义主题才会在下拉菜单中存在。

@Bian-Sh
Copy link
Contributor Author

Bian-Sh commented May 19, 2021

是可以出现的,就是有点延迟了,也不知道过了多久,这个下拉菜单就有了。

@Bian-Sh
Copy link
Contributor Author

Bian-Sh commented May 19, 2021

现在出现新问题:主题选中会报错。
image
image

@Bian-Sh
Copy link
Contributor Author

Bian-Sh commented May 19, 2021

这个报错会延续到新增数据动作和销毁图表的动作中去

@Bian-Sh
Copy link
Contributor Author

Bian-Sh commented Jun 6, 2021

文件夹创建是支持直接给一大段路径的。

@Bian-Sh Bian-Sh closed this as completed Jun 6, 2021
@Bian-Sh Bian-Sh reopened this Jun 6, 2021
@Bian-Sh
Copy link
Contributor Author

Bian-Sh commented Jun 6, 2021

问题还在,重现:
1.加入新的字体:msyh.ttc
2. 创建 linechart,theme 字体改为 msyh
3. 保存此修改的主题为: MSYH
4. 重启 unity ,xchartsetting.customtheme 不出现主题 MSYH (期望值:出现msyh主题)
5. 接上一条,Linechart 中 Theme 下拉框为空白,点击下拉框,也找不见 此 MSYH (期望值:出现msyh主题)
6. 接上一条,xchartsetting.customtheme 手动拖入 MSYH 主题,删除 xchartmgr 以重新加载主题,虽然主题出现在了下拉框,但字体已经不会切换为 mryh 字体了。 (期望值:字体被正确加载切换)

  1. instanceId 不能被存储,实例化对象时产生,但他仅存在于内存中,且生命周期极其短暂,一般重启Unity就会消逝。
  2. 建议使用 scriptableobject 做主题存储,效果可视化且能正确保存形如 font 等数据的引用关系,基于 ymal 序列化的数据量也会很小(如果遇到瓶颈可以一起头脑风暴)
  3. 可以使用这两个属性做数据的提前载入:InitializeOnLoadMethodRuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad) ,前者为编辑器模式后者运行时
  4. 属性数据的载入建议是只载入文件名称即可,无需真实的把数据完全加载进内存,只有使用时加载、赋值。(运行时的可能要额外处理一下)

@monitor1394 monitor1394 added the bug Something isn't working label Jun 9, 2021
@monitor1394
Copy link
Collaborator

master已处理字体引用问题。
1、对于Asset来说,合适的时机instanceId也可以存储。运行时可在打包前再存储一次instanceid,运行时就可以通过instanceid拿到字体。
2、暂不会考虑用scriptableobject做主题,用json更具通用性,主题的字体应该只存字体名就可以。载入到项目后再根据字体名去找到字体。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants