在近代高等程式語言快(ㄏㄨˋ)速(ㄒ一ㄤ)演(ㄔㄠ)化(ㄒㄧˊ)的狀況下,很多 strong type 的程式語言都開始有了 generic 的設計, 舉例來說:
(這只是大略分類)
- Mobile: Swift, Kotlin
- Frontend: Flowtype, TypeScript
- 後端語言:Python (pyre), Scala, C#, Java (沒錯!現在連 Java 都有)
在近代高等程式語言快(ㄏㄨˋ)速(ㄒ一ㄤ)演(ㄔㄠ)化(ㄒㄧˊ)的狀況下,很多 strong type 的程式語言都開始有了 generic 的設計, 舉例來說:
(這只是大略分類)
// MIT License | |
// | |
// Copyright (c) 2018 Sabresaurus | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
// UnityStructGen - Dump the Unity Runtime base type info | |
// Compile with /MT(d), NOT /MD(d) (i.e. use static-linked runtime) | |
// Tested with VS2015 x64. | |
// | |
// To use: | |
// Compile Inject.cpp: | |
// $ cl /O2 /Zi /MT Inject.cpp | |
// Compile UnityStructGen.cpp: | |
// $ cl /O2 /Zi /MT /LD UnityStructGen.cpp | |
// |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditorInternal; | |
using System; | |
using System.Text; | |
using System.IO; | |
public class TestWindow : EditorWindow |
An inline image version of Matt Walker's translation of CEDEC 2017 talks by Nintendo. (I've added italic content.)
Covers four talks:
CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.
In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.
First, let's illustrate the 3 styles by implementing
using UnityEngine; | |
using System.Collections; | |
// This is not need but I just wanted to make the point clear. | |
public class AnimatedComponent : MonoBehaviour | |
{ | |
} |
本次测试包含对AssetDatabase.GetDependencies
和EditorUtility.CollectDependencies
这两个获取资源的依赖资源的 API 的测试,以及对于meta
残留对打AssetBundle
的影响。
输入资源路径,例如Assets/Material/demo.mat
,以路径形式返回该资源依赖的资源列表,例如Assets/Texture/demo.jpg
。
这个 API 返回的结果是“错误”的,也就是带残留的。比如某个材质,原本的shader
引用了4个纹理,然后切换其shader
为新的shader
使之只引用一个纹理,这时AssetDatabase.GetDependencies
返回的结果还是4个纹理。