2013-07-01から1ヶ月間の記事一覧
URL: http://forum.unity3d.com/threads/160249-Destroy-without-MonoBehaviour まずは、UnityEngine;をインポートしておき using UnityEngine; GameObject obj = new GameObject("someobjecttotestdestroy"); UnityEngine.Object.Destroy(obj);
URL: http://answers.unity3d.com/questions/219609/auto-destroying-particle-system.html ここを見ると残りカウントが0になったらDestroyしていた。 C#で置き換えてさらに高速化した。 using UnityEngine; using System.Collections; public class Shurike…
「foo」ファイルにこんなのが記載された場合 ・foo nfuirhguirguir以下のように大文字にして追記するコードを書く nfuirhguirguir NFUIRHGUIRGUIR・upcase.rb こちらでも >|ruby open("foo", "a+") do |f| f.write(f.read.upcase) end |
chompの引数に''などをしない場合、 「\r」「\n」「\r\n」を末尾から取り除く仕様になる ※逆の「\n\r」ではないことに注意 "abc\r\n".chomp() => "abc" ↑「\r\n」が最後から取り除かれる "abc\r\n\r".chomp() => "abc\r\n" ↑最後から「\r」のみが取り除かれ…
splitの第2引数は分割数である。しかし、 p "foo\nbar\nbuz".split(/\n/, 0) => ["foo", "bar", "buz"] ↑0の場合は分割数が0なのでなにもしないのではなく普通に分割。 p "foo\nbar\nbuz".split(/\n/, 2) ["foo", "bar\nbuz"] ↑分割数を満たさないときは、分…
キャラクターの3Dモデルで、アニメーションをAnimationにて追加していると、以下の様なエラーがでる The AnimationClip 'アニメーション名' used by the Animation component 'ゲームオブジェクト名' must be marked as Legacy.3Dファイルの設定にて、「Rig…
このスクリプトが参考になりそう http://docs-jp.unity3d.com/Documentation/Manual/AnimationParameters.htmlメカニムの手順はこちらがいい http://www.shade13.jp/resoueces/Unity_Tips_2.html http://www.shade13.jp/resoueces/Unity_Tips_3.html
IEnumerable<int> 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 2898〜10をそれぞれ2乗した以下になる</int>…
範囲オブジェクトrangeにあるinjectメソッドが何かよくわからないので調べた http://d.hatena.ne.jp/poqute/20061218/p1 (1..3).inject {|r, i| r += i} でも (1..3).inject(0) {|r, i| r += i} もおそらく同じ。 injectの引数は初期値。初期値 init を省略…
URL: http://docs.unity3d.com/Documentation/ScriptReference/ParticleRenderer.htmlrendererとは違い、hitsparkGO.rendererみたいにhitsparkGO.particleRendererがない。 ParticleRenderer particleRenderer = hitsparkGO.GetComponent<ParticleRenderer>(); particleRendere</particlerenderer>…
例えばあるGameObjectにこのようなスクリプトがある。 Start時にStartのログが出る。 using UnityEngine; using System.Collections; public class Spark : MonoBehaviour { // Use this for initialization void Start () { Debug.Log("Start"); } } それに…
・unarchiverがいい http://wakaba.c3.cx/s/apps/unarchiver.html
Python 3.3のダウンロード URL: http://www.python.org/download/releases/3.3.0/僕はこれを選んだ Mac OS X 64-bit/32-bit Installer (3.3.0) for Mac OS X 10.6 and later [2] (sig)インストールが終わったら、さっそく仮想環境「default33」をつくる。 ※P…
英語は“App can’t be opened because it is from an unidentified developer”このサイトを参考にする。 http://osxdaily.com/2012/07/27/app-cant-be-opened-because-it-is-from-an-unidentified-developer/セキュリティの設定で、鍵マークのアイコンを押下…
http://tokyoloader.com/extension.html?r=true Tokyoloaderがいい インストールするだけではダメで、Chrome拡張もインストールする https://chrome.google.com/webstore/detail/tokyoloader/plgbccmjomiejfmopncdemenipnelpcjAimerSoftは有料だし、kigovide…
2013年7月時点では rvm より rbenvだと思う。インストール手順はこちら http://memo.yomukaku.net/entries/ApoFwmfzsh使いは「.zshrc」に↓を記載 export PATH=$HOME/.rbenv/bin:$PATH eval "$(rbenv init - zsh)" #export CC=/usr/bin/gcc-4.2 僕にはこの環…
python django 基礎 (IT寺小屋)紗音寺 URL: http://atnd.org/events/40589@jbking 村岡バージョン0.96からメガフレームワーク scaffold adminなど → これ使うからDjango使う意味があるMTV != MVC 感心事が違う内部的にはControllerがあるModelとTemplateは…
タップで操作したいときに、関係ないボタンの上でタップしても タップとボタンの処理が同時に行われてしまう。 調べるとあった。 URL: http://caitsithware.sakura.ne.jp/wordpress/?p=61重要なのは、メッセージを送りたいGameObjectをUICamera.fallThrough…
韓国でMacBook Proを買ったのでメモしておく。海外で買った時に専用のレシートみたいなのがついてくる。 「Global Blue」などと書いてある。 これを見せるのは飛行機の飛行するゲートで使います。 注意しておくのは、飛行機に載せる荷物には対象の商品を一緒…
URL: http://forum.unity3d.com/threads/33215-Vector-rotationある障害物に対しては避けたいことをしたかった。 このサイトを参考にした。ターゲットに対して進むコードは。 Vector3 targetVec = targetTransform.localPosition - myTransform.localPositio…
listとlist2を連結するには、AddRange(他のリスト)で行う。 List<string> list = new List<string>(); list.Add("abc"); List<string> list2 = new List<string>(); list2.Add("def"); list2.AddRange(list); foreach(string str in list2) { Debug.Log(str); }</string></string></string></string>
Unityのフォルダの中にあるUnity Bag Reporter.appを選ぶ。 Documentを選んで報告
UnityScriptというダメな言語は楽にかけてたが忘れたのでメモ例としてPlayerが死亡した時の処理として書いた。 // 代入されるデリゲート、publicにしないとイベントの定義でDieDelegateがないと怒られる。 public delegate void DieDelegate (); public clas…
void Awake () { Rigidbody myRigidbody = rigidbody; } void Hoge () { myRigidbody.constraints = RigidbodyConstraints.None; } http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-constraints.html には「RigidbodyConstraints.FreezeNo…
・IHoge.cs interface IHoge { void Bar (); T Fuga (); // <- だめ } これだとTの返り値が怒られる。objectとか色々試したがよくわからない。「c# interface method generic return type」にて検索すると、 URL: http://stackoverflow.com/questions/101472…
http://answers.unity3d.com/questions/424048/lookrotation-weird-rotation.html こちらを参考にした private Vector3 myDirection; public void Face(Vector3 direction) { myDirection = direction; //myTransform.rotation = Quaternion.LookRotation (d…
URL: http://wiki.unity3d.com/index.php/Singleton Generic Based Singletonを参考、てかコピペ public sealed class Singleton<T> where T : class, new() { /// <summary> /// Singleton implementation, readonly and static ensure thread safeness. /// </summary> public st</t>…
土日で「Photon Cloud × Unity GameJam」に参加してきた。 URL: http://photoncloud.jp/event0629.html持って行くべきもの アイマスク → 電気つけたままで寝るかもしれないので電源のタコ足プラグ → 電源が足りない恐れを防ぐMacBookなどの延長ケーブル → 電…
https://sites.google.com/site/sunflowerlaboratory/fan-yongsukuriputo
gameObject.SetActiveRecursively(false); や gameObject.active(false); などをするとやたらと `UnityEngine.GameObject.SetActiveRecursively(bool)' is obsolete: `gameObject.SetActiveRecursively() is obsolete. Use GameObject.SetActive(), which is…