The document discusses Assembly Definition (asmdef) files in Unity. It begins by explaining that asmdef files are used to define Assembly configurations in a project. It notes some key points about asmdef files, including that they allow defining assemblies that can be referenced from other parts of a project. It also discusses different ways asmdef files can be structured, such as having one per script folder, one per assembly, or splitting assemblies for editor/playmode tests. Overall, the document provides an overview of what asmdef files are used for and important considerations around their usage and configuration in Unity projects.
The document discusses Assembly Definition (asmdef) files in Unity. It begins by explaining that asmdef files are used to define Assembly configurations in a project. It notes some key points about asmdef files, including that they allow defining assemblies that can be referenced from other parts of a project. It also discusses different ways asmdef files can be structured, such as having one per script folder, one per assembly, or splitting assemblies for editor/playmode tests. Overall, the document provides an overview of what asmdef files are used for and important considerations around their usage and configuration in Unity projects.
25. 型推論の例(3)
? 仮引数の型推論
? 値型(Int, Float等)の推論が失敗しやすい
? 仮引数への入力補完も効かなくなるので
私はあまり多用していない
function circle(r : Float) r * r * 3.14;
function circle(r) r * r * 3.14;
26. 仮引数がうまく型推論できない例
? Float -> Float -> Floatが推論失敗
? 宣言順序によって推論失敗
function add(a, b) a + b;
add(10.5, 3.1); //Float should be Int
function f(x) { /* ... */ }
f(100); //ここで引数の型がIntになる
f(5.5); //NG
function f(x) { /* ... */ }
f(5.5); //ここで引数の型がFloatになる
f(100); //OK
27. 匿名型
? いわゆる構造体
? カスケードも可能
? リファレンス
– http://haxe.org/manual/struct
typedef Object = {
id : Int,
?name : String, //省略可能な項目
}
typedef Rectangle = {>Object,
size : { width : Int, height : Int },
position : { x : Int, y : Int },
}