Project V0.2 Record
coconutnut

重新搭建了场景,unity中运行没问题

Debug

构建后遇到一些bug

按钮文字缺失

构建mac版本后,按钮上的文字消失了,但是其它地方(详情、场景中)都正常

发现原本的按钮使用了TextMeshPro,但是没有必要,改成了用Text的

代码也修改成

1
2
// [SerializeField] private TextMeshProUGUI guideText = null;
[SerializeField] private Text guideText = null;

重新构建,就没有问题了

顺便上一版中第一次点开详情没有文字的bug也消失了

unityFramework is not defined

构建webgl版本后,firefox浏览器加载时进度条卡在80%左右,控制台报错

Uncaught ReferenceError: unityFramework is not defined

(但是发布到itch.io后可以正常显示)

https://forum.unity.com/threads/uncaught-referenceerror-unityframework-is-not-defined-at-htmlscriptelement-script-onload-webgl.803967/

参考↑中一个回答:Try to disable compression

解决😄

之前看教程的时候应该是调过这个参数的,这次搞忘了

V0.2.1

新标签页打开网页

mac版本中,点查看大图会打开浏览器新页面

webgl版本中,点查看大图会直接在当前页跳转

想改成新标签页

参考https://stackoverflow.com/questions/62348214/how-to-open-a-link-on-a-new-tab-using-webgl-c-through-unity

using .jslib file

Assets/plugins/plugin.jslib

1
2
3
4
5
6
7
8
var plugin = {
OpenNewTab : function(url)
{
url = Pointer_stringify(url);
window.open(url,'_blank');
},
};
mergeInto(LibraryManager.library, plugin);

Your C# script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;

public class OpenURL : MonoBehaviour
{
[DllImport("__Internal")]
private static extern void OpenNewTab(string url);

public void openIt(string url)
{
#if !UNITY_EDITOR && UNITY_WEBGL
OpenNewTab(url);
#endif
}

void Update()
{
if (Input.GetKeyDown(KeyCode.Return))
{
openIt("www.wateverurluwant.com");
}
}
}

firefox和itch.io测试均可~

帮助按钮

还需要把帮助按钮加回来

并且默认首次打开程序时弹出显示

V0.2.2

图片模糊问题

把所有图片加进去了

发现千里江山图导入之后很模糊

发现可以调最大尺寸,就清晰了


测试发布的时候V0.2.2,build里面data文件有235.4MB,itch.io无法加载

将图片全体降了一个清晰度,变成114MB,可以加载了,但还是很大

将5种花删成2种,变成104.7MB

把波浪长椅换成和其它地方一样的竹椅,墙外的竹子叶子全删到最少,变成102.1MB

墙外竹子全删掉,变成91.3MB

V0.2.1的时候是42.3MB,看来还是画最占空间