C#のRangeの勘違い
IEnumerable squares = Enumerable.Range(8, 10).Select(x => x * x); foreach (int num in squares) { Debug.Log(num); } これで、以下ようになる、8から10個分進んだものを2乗する 64 81 100 121 144 169 196 225 256 289...
View ArticleDictionaryの使い方 C# Unity
・インデックスパターン dic["キー名"] = "値"; と ・Addメソッドパターン dic.Add("キー名", "値"); の2種類あるが、 Addメソッドパターンだと、キーが既にあるときはエラーになる。 しかし、インデックスパターンは大丈夫だし、もともとなくても追加されるので便利 ・テストした↓ void Start () { Debug.Log ("pattern...
View ArticleMonoBehaviorを継承しないクラスでもDestroyを呼びたい
URL: http://forum.unity3d.com/threads/160249-Destroy-without-MonoBehaviour まずは、UnityEngine;をインポートしておき using UnityEngine; GameObject obj = new GameObject("someobjecttotestdestroy");...
View ArticleShurikenのパーティクルを自動で削除
URL: http://answers.unity3d.com/questions/219609/auto-destroying-particle-system.html ここを見ると残りカウントが0になったらDestroyしていた。 C#で置き換えてさらに高速化した。 using UnityEngine; using System.Collections; public class...
View ArticleRubyのメモ
File.open("foo.txt", "r") do |io| while ! io.eof? print io.read(1) io.seek(1, IO::SEEK_END) # io.seek(1, IO::SEEK_CUR) # io.seek(1) io.seek(1, IO::SEEK_SET) # デフォルトなので上のなにもオプションがないのと同じ end end...
View ArticleUnityとTornado連携
先程の「TornadoでJSONを返す Python」で書いたTornadoのコードをUnityからPOSTできるか試してみた using UnityEngine; using System.Collections; public class PostTest : MonoBehaviour { // Use this for initialization IEnumerator Start ()...
View ArticleTornadoでJSONを返す Python
オライリー本のサンプルをいじった ・json_test.py import os.path import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import json from tornado.options import define, options...
View ArticleUnityのAsset Serverのライセンス買ったのにメニューに出ない
URL: http://answers.unity3d.com/questions/395757/asset-server-is-grey-unity-4-pro-mac-os-lion-1.html 同じ現象の人がいた。 設定はこちら URL:...
View ArticleXamarinでiOSはJITはダメ。
◯ AOT compiler(Ahead Of Time) × JIT compiler(Just In Time) ※中間言語を介してその場その場でネイティブ化する JITコンパイルとの対比で、AOTコンパイルと呼ばれます URL:...
View ArticleNavmesh と rigidbody.AddForce
ジャンプするために rigidbody.AddForce(Vector3.up * 1100); とやってもびくともしなかったが、 Navmeshが邪魔していただけでした。
View Article動的NavmeshのBake Unity
おそらくNavmeshを動的にBakeできない。 Bake済みのプレハブに対してLoadするしかなさげ http://forum.unity3d.com/threads/122545-Problem-with-NavMesh-and-Asynchronous-load
View ArticleNGUIのUISliderについて Unity
実はUISlider.csにUpdateDragというメソッドがあるのでドラッグができる。 単なるゲージのためにUISliderを使うのは危険だからColliderを外しておくこと。
View ArticleMonoBehaviour.OnAnimatorMove() Unity
Mecanimの機能。 Animator のコンポーネントを貼りつけたGameObject に貼りつけたスクリプトに対して、 OnAnimatorMoveを書く。 元々 にチェックボックスになってるところが、 のように「Handled by Scipt」変わる。 Update()と同じように使える。毎フレーム呼ばれる。 FixedUpdate()よりUpdate()に近い。 URL:...
View Articlerootの階層へGameObjectを移動 Unity
URL: http://docs.unity3d.com/Documentation/ScriptReference/Transform-parent.html ゲーム開発の民主化を謳うUnityだが、公式サンプルにコードは有るが何の説明もない・・。 using UnityEngine; using System.Collections; public class Example :...
View ArticleUnity JSONパーサ
URL: http://wiki.unity3d.com/index.php/JSONObject JSONObjectなるものがあるが、 { "Image":{ "Width":800, "Height":600, "Title":"View from 15th Floor" } のように「:」のあとに半角スペースがないものしか出来ないので、 { "Image": { &qu ...
View ArticleChefなどのインストール
Rubyやgemが必要です。 URL: https://learnchef.opscode.com/quickstart/workstation-setup/ ・chefインストール curl -L https://www.opscode.com/chef/install.sh | sudo bash ・knife-soloのインストール sudo gem install knife-solo...
View ArticleVagrantのインストール
・Vagrant・・・仮想マシンを簡単に立ち上げるツール ・VirtualBox or VMWare or EC2が必要 URL: https://www.virtualbox.org/ ↑からVirtualBoxのインストール そのあとで、Vagrantをインストール URL: http://downloads.vagrantup.com/ Boxは公式サイトにサンプルあるが、...
View Article丸の内MongoDB勉強会 #12 in 納涼もんご祭り
URL: http://atnd.org/events/41167 丸の内MongoDB勉強会の特徴 林田さん guthubにある Node.js + Express + Mongoose + MongoDB ※Express・・・RubyのSinatraのようなもの @novi_ Yusuke Iyo DocumentとEmbed Documentを使用 ブログアプリ コンテンツアプリシステム...
View Articlecocos2d-xの情報
・Facebookグループ https://www.facebook.com/groups/152840204871454 ・グループ http://www.cocos2d-x.jp/ ・SlideShare http://www.slideshare.net/doraemonsss/
View Article