2011-06-01から1ヶ月間の記事一覧
http://d.hatena.ne.jp/ousttrue/searchdiary?word=%2A%5BBlender%5D からの http://sourceforge.jp/projects/meshio/wiki/FrontPage で meshio-blender25 (pymeshio-1.8.6.zip) をDLして配置。 Readmeを見てチェックを入れたらImportできた。 テクスチャの…
Movie Playback is only possible with Unity Pro.だってさー! ;_;
平行投影のゲームも作れる! 右上のギズモをShift+クリックでIso Viewになる。 タクティクスオウガのように、遠いキャラも同じ大きさに見えるようになる。 ゲームのProjectionをそのようにしたければ、 カメラのProjectionをOrthographicにすればよい。
赤い球に入った敵AIだけを有効にする工夫。 カメラに見えないオブジェクトをunableにするOnBecameVisibleもあるけれど、 http://www.cis.sojo-u.ac.jp/~izumi/Unity_Documentation_jp/Documentation/ScriptReference/index.Performance_Optimization.html 背…
//from ScriptB scriptA = GetComponent("ScriptA");
■子や親を探す 子や親のオブジェクトをゲームオブジェクトのTransformコンポーネントから探せる // Find the child "Hand" ofthe game object // we attached the script to transform.Find("Hand").Translate(0,1, 0); ■関数 transformを階層から発見したら…
function Update () { otherScript = GetComponent(OtherScript); otherScript.DoSomething(); } 次のスクリプトとOtherScriptを、同じゲームオブジェクトに付加してくださいこうやって必要な関数だけをオブジェクトに追加していける! http://www.cis.sojo-…
レースゲームとかに使えるね! 昔のアーケードレースゲームの時点で、 ハンドルを少しだけ切ったら微妙に動いて、 ハンドルを大きく切ったら大きく動く工夫がされていました。 入力と、物体を動かす力が線形ではなく、二次関数の方がよい。 ヒント:方向ベク…
回転する箱からビームが出ていて、Player(YOU)がジャンプでよけるゲーム。 ビームに当たるとYOUは血(パーティクル)を吐く。 ビームと同じ方向にRayを発射することでヒットを取っている。 Playerのスクリプト(血パーティクルは事前にPrefabにしてから登録) va…
function OnGUI () { if (GUI.Button (Rect (10,10,150,100), "I am a button")) { print ("You clicked the button!"); } create emptyしたものにこのスクリプトをドラッグすれば表示されます。 function OnGUI () { if (GUI.Button (Rect (10,10,100,50), …
yield WaitForSeconds(5.0);var spawnOBJ : GameObject; private var busy = false; //プライベート変数はこのスクリプト内でのみ参照できる変数で、インスペクター上でも表示されません function DoSpawn () { if (!busy){ busy = true; yield WaitForSecon…
■Update () ■FixedUpdate() Update 同様ゲーム画面が更新されたときに実行されます。但し、Update と違い、フレーム間の時間は処理の重さにかかわらず常に一定です。 Rigidbodyなど物理演算を使用する命令の場合はこちらを使用することが 一般的です。 ■Awak…
function Update () { transform.Translate(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); } これをカメラにセットしたら「カメラが」動く.
http://unity3d.com/support/documentation/ScriptReference/KeyCode.html
var playerObj : GameObject; var aTexture : Texture; function OnGUI () { var pivotPoint : Vector2 = Vector2(35, 35); var angleY : float = playerObj.transform.localEulerAngles.y; GUIUtility.RotateAroundPivot(angleY, pivotPoint); GUI.DrawText…
Application.LoadLevel(“名前”)Outputするときは使用するシーン全てを出力する必要があり、 file>build settingsでシーンを登録。ID=0のものが最初に読み込まれる.
衝突して吹っ飛ぶ時 void OnCollisionEnter(Collision other) { ... } void OnCollisionStay(Collision other) { ... } void OnCollisionExit(Collision other) { ... } アイテムなど、フラグだけ取りたい時 void OnTriggerEnter(Collision other) { ... } v…
split animation http://gp-portal.jp/material/refMaterial/2255_Unity_document01.pdf function Awake () { animation.Play("run"); } function Update () { if(Input.GetButtonDown ("Fire2")) //マウス右クリックあるいは ALT キー { SendMessage ("Dida…
function OnCollisionEnter(theCollision : Collision){ if(theCollision.gameObject.name == "Floor"){ Debug.Log("床に落ちました"); } } function OnCollisionEnter(coll : Collision) { var obj = coll.gameObject; Debug.Log (obj.name); if (obj.name …
Beginner/Essentialsのチュートリアルを見ている。 思い出しやすいように、以下に各章の内容をメモする。 Intermediate I01 – Raycasting function Update () { var up = transform.TransformDirection(Vector3.up); var hit : RaycastHit; Debug.DrawRay(tr…
function OnDisable(){ Debug.Log('dtor!'); } OnEnable This function is called when the object becomes enabled and active. OnDisable This function is called when the behaviour becomes disabled () or inactive. http://unity3d.com/support/docum…
var theMaterial : Material; ... renderer.material = theMaterial;
transform.localScale = Vector3(2,2,2);
unity2.xのときはrigidbody.AddForce(0,10,0)の形式でしたが、 3.xではベクトルを入力するようです。It works! using UnityEngine; using System.Collections; public class PlayerBehaviour : MonoBehaviour { // Use this for initialization void Start (…
macportsでopencvをインストール. opencv1.0のときのlibは消えた. mac opencv2.2で入ったものは以下 mymac:lib fromjpn$ pwd /opt/local/lib mymac:lib fromjpn$ ls libopencv* libopencv_calib3d.2.2.0.dylib libopencv_core.dylib libopencv_gpu.2.2.dylib…
opencv2.2にしてからxcodeで動かないー>< サンプルは動いたんだけどなー あとちょっと #include <stdio.h> #include "cv.h" #include "highgui.h" #include "globalVariable.h" int main(int argc, char** argv){ IplImage* hoge; hoge = cvLoadImage("camera.png",</stdio.h>…
LV41以上のゴマゾウ6匹で200戦。 20個拾った。 期待値は1% * 200 * 6 = 12個なので、 豊作でした♪
mac + opencv1.0 + snow leopard でサンプルを動かそうとしている途中で出たエラー。 途中までは過去の記事を参照。 includeはできているようだったので アーキテクチャの設定がおかしい! プロジェクト→プロジェクト設定→ ビルドタグ→アーキテクチャ→32-bit…
休日に歩き疲れた>< <●>_<●>