• Unity团结引擎使用总结


    团结引擎创世版以 Unity 2022 LTS 为研发基础,与 Unity 2022 LTS 兼容、UI 也基本保持一致,使 Unity 开发者可以无缝转换到团结引擎。融入了团结引擎独有功能和优化,未来会加入更多为中国开发者量身定制的功能和优化。

    目前正在内测,喜欢的朋友看过来!
    团结引擎官网

    在导出时会有个额外的平台Weixin MiniGame,切换下平台Switch Platform,Build导出,这个需要花点时间。

    Failed to download file Build/h5.data.gz. Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host content, or use the Build and Run option.

    提示我们必须把构建出来的文件放到web容器里

    Unable to parse Build/h5.framework.js.gz! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header “Content-Encoding: gzip” present. Check browser Console and Devtools Network tab to debug.

    需要在服务器配置上下加上以下配置:
    WebGL:服务器配置代码示例

    # On-disk Brotli-precompressed data files should be served with compression enabled:
    location ~ .+\.(data|symbols\.json)\.br$ {
        # Because this file is already pre-compressed on disk, disable the on-demand compression on it.
        # Otherwise nginx would attempt double compression.
        gzip off;
        add_header Content-Encoding br;
        default_type application/octet-stream;
    }
    
    # On-disk Brotli-precompressed JavaScript code files:
    location ~ .+\.js\.br$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding br;
        default_type application/javascript;
    }
    
    # On-disk Brotli-precompressed WebAssembly files:
    location ~ .+\.wasm\.br$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding br;
        # Enable streaming WebAssembly compilation by specifying the correct MIME type for
        # Wasm files.
        default_type application/wasm;
    }
    
    # On-disk gzip-precompressed data files should be served with compression enabled:
    location ~ .+\.(data|symbols\.json)\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        default_type application/octet-stream;
    }
    
    # On-disk gzip-precompressed JavaScript code files:
    location ~ .+\.js\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        default_type application/javascript;
    }
    
    # On-disk gzip-precompressed WebAssembly files:
    location ~ .+\.wasm\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        # Enable streaming WebAssembly compilation by specifying the correct MIME type for
        # Wasm files.
        default_type application/wasm;
    }
    
    
    • 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
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48

    发一个完整的配置:

    server {
        listen       80; 
        listen       443 ssl;
    	root /home/gamioo/games;
        index index.html index.htm;
        server_name  allen.gamioo.com;
        access_log  logs/allen.gamioo.com.access.log json;
        ssl_certificate ssl/gamioo.com.crt;
        ssl_certificate_key ssl/gamioo.com.key;
    
    # On-disk Brotli-precompressed data files should be served with compression enabled:
    location ~ .+\.(data|symbols\.json)\.br$ {
        # Because this file is already pre-compressed on disk, disable the on-demand compression on it.
        # Otherwise nginx would attempt double compression.
        gzip off;
        add_header Content-Encoding br;
        default_type application/octet-stream;
    }
    
    # On-disk Brotli-precompressed JavaScript code files:
    location ~ .+\.js\.br$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding br;
        default_type application/javascript;
    }
    
    # On-disk Brotli-precompressed WebAssembly files:
    location ~ .+\.wasm\.br$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding br;
        # Enable streaming WebAssembly compilation by specifying the correct MIME type for
        # Wasm files.
        default_type application/wasm;
    }
    
    # On-disk gzip-precompressed data files should be served with compression enabled:
    location ~ .+\.(data|symbols\.json)\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        default_type application/octet-stream;
    }
    
    # On-disk gzip-precompressed JavaScript code files:
    location ~ .+\.js\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        default_type application/javascript;
    }
    
    # On-disk gzip-precompressed WebAssembly files:
    location ~ .+\.wasm\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        # Enable streaming WebAssembly compilation by specifying the correct MIME type for
        # Wasm files.
        default_type application/wasm;
    }	
    }
    
    
    • 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
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59

    Unable to load file Build/h5.framework,js.gz! Check that the file exists on the remote server. (also check prowser Console and Devtools Network tab to debug)

    提示我们部分文件找不到,一般是nginx路由配置有问题

    发布的时候最好压缩改成Gzip,而不是默认的Brotli ,因为很多nginx服务器默认都没有安装这个组件,
    按照如下修改:
    在这里插入图片描述

    warning: FS.syncfs operations in flight at once, probably just doing extra work

    不知是何原因?

    Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at h5.loader.js:1:9231

    一开始以为是在浏览器中跑导致的问题,放到微信里打开果然好了,但后来把配置文件优化了下,居然也好了,看来还是配置的问题。把以下两行放到了配置的根部:

    Hidden/Universal/HDRDebugView shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

    表示该Shader代码中的所有SubShader都不支持

    root /home/gamioo/games;
    index index.html index.htm;
    
    • 1
    • 2

    发布的H5游戏如下,效果还可以:
    在这里插入图片描述
    团结引擎的论坛

  • 相关阅读:
    安装sourcetree并操作Git
    layui好用的组件基本使用
    day60
    软件测试流程
    什么时候用 C 而不用 C++?
    vue3 | defineExpose的使用
    python爬虫实战之逆向分析酷狗音乐
    【Redis】Redis 淘汰、雪崩、击穿、穿透、预热
    为何 DevOps 会给开发人员带来压力和倦怠?
    SqlServer命名规范
  • 原文地址:https://blog.csdn.net/jiangguilong2000/article/details/134537290