惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
F
Fortinet All Blogs
B
Blog
GbyAI
GbyAI
P
Proofpoint News Feed
量子位
The Register - Security
The Register - Security
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
B
Blog RSS Feed
WordPress大学
WordPress大学
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Webroot Blog
Webroot Blog
AWS News Blog
AWS News Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
O
OpenAI News
月光博客
月光博客
H
Hacker News: Front Page
S
Security Affairs
W
WeLiveSecurity
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Help Net Security
Help Net Security
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
S
Securelist
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
T
Threat Research - Cisco Blogs
M
MIT News - Artificial intelligence
A
About on SuperTechFans

UNITY

刚才清理废纸篓的时候发现一封没看的 unity 邮件, 这是以后不让用 Unity 开发国外版本的游戏了? 逼着使用腾讯的 Tuanjie 引擎吗? Tuanjie 打出来的包好像会强加水印啥的. - V2EX 中国区用户的海外 Unity 资源商店的访问权限将于 2026 年 3 月 31 日终止 有哪个头显是能实时连接 Unity 编辑场景的? - V2EX unity 国区账号如何下载 unity 商店资源? - V2EX unity 可以做三维建模 vr 效果吗 - V2EX gaia pro 问题请教 - V2EX Cursor 等一众 AI 编程工具目前和 Unity 游戏开发的结合怎么样了? Unity 游戏开发想用 AI 提高生产率目前都有什么比较好的方案或者工具? - V2EX Unity 股价只剩三年前的 10%了(200USD=>20USD)会不会被哪个大公司收购? - V2EX Unity 6 现在国区不让下载了 - V2EX Unity 答疑,任何问题都可以 - V2EX 当我用 Unity 开发游戏的时候有什么场景下要使用“栈”操作? - V2EX 为什么 Unity 自带的资源加密功能是中国版特供的? - V2EX Unity 远程开发岗位,感兴趣小伙伴看过来 - V2EX unity 2D 像素精灵的生成有推荐的方法吗? - V2EX 远程 Unity 开发工程师(英国) - V2EX 求推荐点 Unity 入门教程 - V2EX 请教个语音听写的问题 - V2EX Unity 打包后出现 "trial version" - V2EX 有没老哥用 m2 开发 unity 的 - V2EX 如何看待 Unity 新出的每次安装收费? - V2EX 为什么 Unity 的定价策略增加了对安装量的限制? - V2EX unity 将于 2024 年 1 月调整收费模式 - V2EX [Unity 离奇 Bug] 游戏在编辑器内运行 ok,构建出的 exe 却不能在本机正常运行 - V2EX 3 维空间中,求过原点的直线的方向向量? - V2EX 求推荐资源 - 俯瞰视角场景设计相关 - V2EX 震惊,有个框架竟然能快速让 Unity 新手制作可热更游戏!竟然可以让老项目快速对接具备热更性质! - V2EX 大佬们 学习 Unity 遇到的两个问题求助 - V2EX 有人对 unity 的 photon 组件熟悉的嘛,想有偿咨询几个问题 - V2EX 用 Unity3d 来做跨平台开发是不是很好? - V2EX 有偿提供 unity 虚拟面试~ - V2EX 问一下各位大哥关于买网络授课是否有必要的问题 - V2EX 请问通过 unity WebGL 能播放 rtmp,可以实现吗? - V2EX [UnityTips] 一种仿 Minecraft 物品合成的思路 - V2EX ShaderLab 入门实践 - V2EX Unity 热更新 之 如何使用 AST 转换 C# -> Lua - V2EX 按需渲染如何改善移动端性能? - V2EX 怎么通过 Unity 使用 Vulkan API & 移动端 Vulkan GPU 大 PK - V2EX Unity3D 实用技巧 - 快速学会模型合理导入 Unity3D 引擎 - V2EX Unity3D 实用技巧 - 从实践中总结经验(1) - V2EX [HDRP] PBR Lit shader(一.基础用法篇) - V2EX 如何将 Unity 以库形式集成到原生 iOS 和 Android 应用 - V2EX 如何在 Timeline 中创建自定义轨道? - V2EX 写给 Unity 开发者的 iOS 内存调试指南 - V2EX Unity3D 常用插件汇总 - V2EX 在 Unity 实现游戏命令模式 - V2EX Unity ECS(一)了解 ECS 与 DOTS - V2EX 使用 Unity 制作游戏 AI - V2EX 零基础入门 Unity Shader(二) - V2EX 如何实现存储和加载游戏数据 - V2EX
对于 U3D Stopwatch ElapsedTick 的疑惑 - V2EX
bakatori · 2020-06-11 · via UNITY

记录方法

    static public void time (string key) {
        if (timeKeyHub.ContainsKey (key)) {
            Debug.LogError ("MLOG.cs time key already exist");
        } else {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch ();
            timeKeyHub.Add (key, sw);
            sw.Start ();
        }
    }
    static public void timeEnd (string key) {
        if (timeKeyHub.ContainsKey (key)) {
            System.Diagnostics.Stopwatch sw;
            timeKeyHub.TryGetValue (key, out sw);
            sw.Stop();
            Debug.Log (string.Format ("<color=blue>{0}</color> {1} ms {2} ticks", key, sw.ElapsedMilliseconds, sw.ElapsedTicks));
            // BIRDTODO:用池子
            sw = null;
            timeKeyHub.Remove (key);
        } else {
            Debug.LogError ("MLOG.cs timeend key not exist");
        }
    }

A*算法的部分代码

    MLOG.time("newCostDealer");
    MLOG.time("newCostDealer - newCost");
    float newCost = cost_so_far[cur]+ heuristic(next.Pos, end.Pos);
    MLOG.timeEnd("newCostDealer - newCost");

    MLOG.time("newCostDealer - 0");
    bool tmp2 = !cost_so_far.ContainsKey(next);
    MLOG.timeEnd("newCostDealer - 0");

    MLOG.time("newCostDealer - temp3");
    bool tmp3 = false;
    if (!tmp2) {
        tmp3 = newCost < cost_so_far[next];
    }
    MLOG.timeEnd("newCostDealer - temp3");

    if (tmp2 || tmp3)
    {
        MLOG.time("newCostDealer - 1");
        frontier.put(next, newCost);
        MLOG.timeEnd("newCostDealer - 1");

        MLOG.time("newCostDealer - 2");
        cost_so_far[next] = newCost;
        // MLOG.info("came_from[next] = cur," + next.ToString() + " " + cur.ToString());
        came_from[next] = cur;
        MLOG.timeEnd("newCostDealer - 2");
    }

    MLOG.timeEnd("newCostDealer");

运行结果:

tIfWA1.png

求教,为啥 newCostDealer ticks 和其它记录加起来差那么多丫?!