Lunatic-Works / Nova

Programmer-friendly framework for visual novels (VN) / text-based adventure games (AVG) on Unity
MIT License
591 stars 78 forks source link

关于Live2D打包产生的问题 #44

Closed rin-miku closed 1 year ago

rin-miku commented 1 year ago

不论是将Live2D移动到 Nova/Sourecs 目录下,还是手动创建Live2D的asmdef文件并在Nova.asmdef文件中引用,打包时指向同一个错误: Script updater for Library\Bee\artifacts\1900b0aP.dag\Nova.dll failed to produce updates.txt file 初步猜测与项目依赖相关,但暂时未找到解决方案

woct0rdho commented 1 year ago

你试试这里面说的 https://forum.unity.com/threads/error-when-changing-scripts.1023646/

也许需要升级Unity小版本,或者把项目移到别的地方(比如直接在C盘下面,不要在我的文档等等特殊的地方,路径里不要有空格或者中文)

rin-miku commented 1 year ago

你试试这里面说的 https://forum.unity.com/threads/error-when-changing-scripts.1023646/

也许需要升级Unity小版本,或者把项目移到别的地方(比如直接在C盘下面,不要在我的文档等等特殊的地方,路径里不要有空格或者中文)

这些网上已有方法已经尝试过,均未解决 我之所以说可能是依赖问题,是因为除上述所说的报错之外,还有Live2D无法找到例如 UnityEditor 命名空间的报错 我猜测是因为 Nova 需要依赖 Live2D 但 Live2D 所依赖的项目正在依赖 Nova 这会产生循环依赖,目前解决方案下有以下项目: Assembly-CSharp-Editor Live2D Nova Nova.Tests 其中 Editor 依赖 Nova , Nova 依赖 Live2D

woct0rdho commented 1 year ago

我们自己其实还没用过Live2D,我得问问别人

@sepcnt 你们是怎么搞的

sepcnt commented 1 year ago

直接导入包https://www.live2d.com/en/download/cubism-sdk/ 如果引用出问题,把Nova和Live2D的asmdef都删了,或者在导入包的文件夹下面创建asmdef然后添加引用。

rin-miku commented 1 year ago

直接导入包https://www.live2d.com/en/download/cubism-sdk/ 如果引用出问题,把Nova和Live2D的asmdef都删了,或者在导入包的文件夹下面创建asmdef然后添加引用。

依然无法打包 报错均为Live2D各目录下Editor文件夹中的脚本 例如: Assets\Nova\Sources\Live2D\Cubism\Framework\MotionFade\Editor\CubismFadeMotionImporter.cs(15,19): error CS0234: The type or namespace name 'Animations' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?) Assets\Nova\Sources\Live2D\Cubism\Framework\Pose\Editor\CubismPoseMotionImporter.cs(32,10): error CS0246: The type or namespace name 'InitializeOnLoadMethod' could not be found (are you missing a using directive or an assembly reference?)

woct0rdho commented 1 year ago

我刚刚试了一下,只要把那些Editor文件夹里的东西都移到Assets/Nova/Editor/里面,就能build

比如你可以把Editor文件夹里的东西都移到Assets/Nova/Editor/ThirdParty/Cubism/,剩下的移到Assets/Nova/Sources/ThirdParty/Cubism/

另外,Assets/Nova/Sources/Nova.asmdef要设成允许unsafe

我们的习惯是把Runtime和Editor的代码分开,其他很多Unity的包(比如LoopScrollRect)也在这么搞,虽然Live2D目前没有这么搞

rin-miku commented 1 year ago

感谢您一直关注该问题,上边提到的方法是正解 需要将Live2d目录下所有 Editor 文件夹按照原有目录复制到Assets/Nova/Editor/ThirdParty/中 例如Framework Plugins Samples及其子目录下的 Editor 等 不得不说Live2d这个代码组织相当阴间hhh 或许后续您可以将该情况加入Wiki 因为Live2d使用频率应该不会低 再次感谢各位的帮助 希望各位有个愉快的新年假期