URL: http://atnd.org/events/34622
ネタがそろそろなくなりましたね。
Booは変数の代入がすっきり書けます。
Start関数の最初の3つは通常の書き方ですが、
「x, y, z = 2, 4, 8」の用に書けますね。PythonとかRubyっぽく。
import UnityEngine class AssignTest(MonoBehaviour): def Start(): x as int = 1 y as int = 3 z as int = 6 x, y, z = 2, 4, 8 Debug.Log(x) Debug.Log(y) Debug.Log(z)
世間ではまだこんな言語を使ってる方がいますが、
UnityScriptではできない。
#pragma strict function Start() { var a : int; var b : int; var c : int; a, b, c = 1, 2, 4; Debug.Log(a); Debug.Log(b); Debug.Log(c); }
はい、残念
Assets/Scripts/NewBehaviourScript.js(10,9): BCE0043: Unexpected token: a. Assets/Scripts/NewBehaviourScript.js(10,12): BCE0043: Unexpected token: b. Assets/Scripts/NewBehaviourScript.js(10,20): BCE0043: Unexpected token: ,. Assets/Scripts/NewBehaviourScript.js(10,21): UCE0001: ';' expected. Insert a semicolon at the end. Assets/Scripts/NewBehaviourScript.js(10,22): BCE0043: Unexpected token: 2.
では、次へ