2013-01-01から1年間の記事一覧
例えば、WWWやWaitForSecondsなどを使いたい時、 コルーチンは必須になる。例として、このように書いた。 このUnity用UnitTestツールであるNUnitLiteは、 MonoBehaviourを継承してアタッチして使うタイプだが、 今回SomeTestInPlugins自体には普通はMonoBeha…
Hoge["key"] のようなDictionaryのものを Hoge["key"].ToString (); のように文字列に変換すると、Nullの場合 NullReferenceException: Object reference not set to an instance of an objectのようなエラーが出る。URL: http://stackoverflow.com/question…
パフォーマンスを僕が測ったのではないが、 TryGetValueの方が速いっぽい。 BlogURL: http://www.dotnetperls.com/trygetvalueフォーラムURL: http://stackoverflow.com/questions/9382681/what-is-more-efficient-dictionary-trygetvalue-or-containskeyitem
HogeクラスのYieldのあるメソッド public IEnumerator YieldFunction (string argStr, System.Action<Dictionary<string, object>> returnData) { WWWForm form = new WWWForm (); form.AddField ("hoge_form", argStr); WWW www = new WWW ("http://example.com/hoge", form); yield re</dictionary<string,>…
例えばこのように定義しているクラスがあるとする。 ※キーが重複している using UnityEngine; using System.Collections; using System.Collections.Generic; public class HogeConstants { public const string HOGE1 = "aiueo"; public const string HOGE2…
参考URL:http://stackoverflow.com/questions/14183895/mogenerator-error-skipping-entity-myobjectname-nsmanagedobject-because-it-doeこのエラーは「travelphoto.xcdatamodeld」にて、「Class」を設定しないといけない。
[!] The platform of the target `Pods` (iOS 5.0) is not compatible with `ELCImagePickerController (0.2.0)` which has a minimum requirement of iOS 6.0.Podfileでの記載を pod 'ELCImagePickerController', '0.1.3'にした。
[!] The platform of the target `Pods` (iOS 5.0) is not compatible with `AFNetworking (2.0.0)` which has a minimum requirement of iOS 6.0 - OS X 10.8.Podfileでの記載を1.3.1を使えるように、 #pod 'AFNetworking' pod 'AFNetworking', '1.3.1'こう…
pod installをすると、 CocoaPods 0.28.0 is available.と緑の表示が出てたら既存のバージョンよりも新しいのが出ている。 pod --versionアップデートする sudo gem install cocoapodsコマンド:http://qiita.com/hirobe/items/7e88cc57a9e74251862a
・補完が賢い ・BoxCollider2D z奥行きは別物なのに、xとyさえ合っていればコリジョンしてくれます。 ちなみに、衝突判定は従来のやつに2Dを追加した「OnCollisionEnter2D」でやります。 void OnCollisionEnter2D (Collision2D coll) { Debug.Log ("OnCollis…
Unity 4.3からXamarinにエディタがアップデートされた。 空白の表示がデフォでは出てない。 からメニューを選び、 Markars and Rulersを選び、Show invisible characterから、Alwaysを選択。
↑の本を参考 Xcode用の備忘録として書いた・Targetの設定 既存のProjectへ追加する。 ちなみに既存のプロジェクトは「GHUnitBase」で作ってます。 Xcodeの4.xではAdd Targretの「+」ボタンが左下のあたりにあったが、version 5ではそこにはない。 ・「Edito…
rake rails_admin:install - Hello, RailsAdmin installer will help you set things up! - I need to work with Devise, let's look at a few things first: - Checking for a current installation of devise... - Found it! - Looks like you've already …
rake -D rails_adminとやると Reason: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0 のエラー発生。URL: https://gist.github.com/vparihar01/5856524 のgist通りにやっ…
gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git', :branch => 'rails-3.0'にしないで 単に、 gem 'rails_admin'としてしまうとRails4.x用のが入るっぽい。。
ContainsKeyとItemを合体したようなメソッド。 ContainsKeyで確認してたがこっちのほうがいいかも?・Dictionary TryGetValue or ContainsKey+Item? URL: http://stackoverflow.com/questions/9382681/what-is-more-efficient-dictionary-trygetvalue-or-con…
・Rails 3のエラー rails g model message body:stringでモデルを作ろうとすると、 Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine. Run `bundle install` to install missing gems.のエラー・Gemfile #gem 'mysql2' gem '…
NGUIのTween機能のUITweenerについて、 再生を普通の再生と逆再生ができる。fowardのオプションが引数のbool型だったので、 myTweenをUITweenerとすると、 普通の向きの再生は、 myTween.Play (false); 逆の向き(foward)の再生は、 myTween.Play (true);
UIButtonMessageを使わなくてもできる EventDelegateのリストで複数設定できるが、1つでもOK。MonoBehaviourの変数はtargetMono UIButtonの変数はmyButton List<EventDelegate> list = new List<EventDelegate>(); EventDelegate del = new EventDelegate (); del.target = targetMono; del</eventdelegate></eventdelegate>…
AIのプラグイン。 githubのURL: https://github.com/ricardojmendez/UnitySteerYouTubeのURL: http://www.youtube.com/watch?v=4ULDER6zJnU
URL: http://wiki.unity3d.com/index.php/Flockingボイドの動きのサンプルコードが有る。 残念ながら、普通のまともなエンジニアなら選択しないUnityScriptというもの。 コード自体も誤りが多く、さすがUnityScriptのコードだ。 現状は私が修正したコードが…
URL: http://docs-jp.unity3d.com/Documentation/Components/class-MovieTexture.html Play ()がないと怒られる↓ こっちが正しい? URL: http://docs.unity3d.com/Documentation/ScriptReference/MovieTexture.Play.html using UnityEngine; using System.Co…
Manifest.xmlからAndroidManifest.xmlへコピーして完璧だと慢心していてると、 「FacebookTestScene」シーンサンプルの FacebookAndroid.showDialog( "stream.publish", parameters ); が動かないのに、 FacebookAndroid.showFacebookShareDialog( parameter…
<hash> <error>Desktop applications only support the oauth_callback value 'oob'</error> <request>/oauth/request_token</request> </hash> の謎のエラー。 URL: http://forum.unity3d.com/threads/92154-Prime31-Android-Plugins-Officially-Live!/page42以前自分で聞いたフォーラムが出た! TwitterのD…
Objective-Cでは、メソッドを呼ぶときに各変数の名前を書かせるのを矯正されるが、 C#も同じような書き方ができた。 using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { void Start () { Hoge (intVal:1, str…
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
URL: https://www.assetstore.unity3d.com/#/content/10989Prime31とかが今までUnityのPluginを出していたが、これはFacebookが公式に出してるっぽいので試す。ドキュメントURL: https://developers.facebook.com/docs/unity/すでにAssetStoreからインストー…
GameObjectを渡して、親をさかのぼってComponentを探せる UIRoot mRoot = NGUITools.FindInParents<UIRoot> (gameObject);</uiroot>
URL: http://chiyoworks.blogspot.jp/2013/05/storyboard-scrollview.html UIScrollViewの中にContentViewを入れる。 ContentViewってのは、サブViewにしたUIViewとかImageViewとかと思う・・。ちなみに、UIScrollViewに対してはこのコードを書いている - (v…
string buttonName = UIButton.current.name;