2012-07-22から1日間の記事一覧

unity 二次元配列 javascript 2d-array

#pragma strict //item table var item_num = 10; var tbl : float[,]; function Start () { //init tbl = new float[10,10]; for(var i=0; i<10; i++){ for(var j=0; j<10; j++){ tbl[i,j] = 0; } } //set value tbl[0,0] = 1; tbl[0,1] = 2; tbl[0,2] = 3;…

unity マリオカート コウラ 実装

Add "Physic Material" to bullet. var bullet_prefab : Transform; //add rigidbody, beforehand private var bullet_point : GameObject; //child of kart function Start () { bullet_point = GameObject.Find("bullet_point"); } function shot_bullet()…

unity 弾を撃つ スクリプト

var cube : Transform; function Start () { for (var y = 0; y < 5; y++) { for (var x = 0; x < 5; x++) { var cube = Instantiate(cube, Vector3 (x, y, 0), Quaternion.identity); } } } http://docs.unity3d.com/Documentation/Manual/InstantiatingPre…

unity 実行時 プリミティブ 生成

function Start () { for (var y = 0; y < 5; y++) { for (var x = 0; x < 5; x++) { var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.AddComponent(Rigidbody); cube.transform.position = Vector3 (x, y, 0); } } } http://docs.unity3d…