Unity
AssetDatabase.SaveAssets ();の動作は「Save Project」と同じ。 なのでショートカット作成しよう。 using UnityEditor; using UnityEngine; public class MyEditorWindow : EditorWindow { [MenuItem("File/Save Project %&s")] static void SaveProject() …
よく、シーンがm_LocalScale: {x: 1.0000376, y: 1.0000376, z: 1.0000376}みたいになってるかと using UnityEditor; using UnityEngine; if (GUILayout.Button ("チェック")) { List<string> nameList = new List<string> (); RectTransform[] rectTransforms = GameObject.</string></string>…
PlayMaker的なStateMachineの図みたいなのをEditorで作りたい BahaviorMachineという無料アセット有るけどdllだった・・・ https://www.assetstore.unity3d.com/en/#!/content/20280 https://forum.unity3d.com/threads/drawing-lines-in-the-editor.71979/ …
コレに参加 http://japan.unity3d.com/blog/press/20161121 プロジェクト入れると変なワーニング・・・ A default asset was created for 'Assets/Etc/playGROWnd/playground/Audio/Musics/NewAudioMixer 1.mixer' because the asset importer crashed on it…
自動で配置する機能を使った場合にRectTransformのHeightは "Some values driven by ContentSizeFitter"とかメッセージが出てそれで計算されているっぽい。 しかし、試しにRectTransformの rect.y とか rect.size.y とか sizeDelta.yでは0が返却される。 グ…
2Dユニティちゃんのデモゲームが参考になった https://github.com/anchan828/property-drawer-collection/blob/master/SceneName/SceneNameAttribute.cs これ使えば [SceneName] [SerializeField] private string nextLevel; とか使える。
Unity - マニュアル: JSON 形式にシリアライズ 今更ながらJsonUtility using UnityEngine; using System.Collections; public class JsonTest : MonoBehaviour { // Use this for initialization void Start () { MyClass myObject = new MyClass (); myObje…
[MenuItem("GameObject/選択GameObject数表示", false, 1)] static void CountSelectObjects(MenuCommand menuCommand) { int count = Selection.gameObjects.Length; // これがないと二度以上実行される. if (count > 1) { if(menuCommand.context != Selec…
GitHub - onevcat/UnpauseMe: Script for Unity3D, unpause Unity3D animations or particles when set Time.timeScale = 0. これ。 Animatorのならプルダウンでできるが、レガシーアニメーションはできない。 UnpauseMe/AnimationPlayIgnoreTimeScale.cs at…
面倒なので拡張 public static class Extends { /// <summary> /// Gets the bool array value. /// boolの配列を取得する. /// </summary> /// <returns>The bool array value.</returns> /// <param name="myProp">My property.</param> /// <param name="key">Key.</param> public static bool[] GetBoolArrayValue(this SerializedProp…
Xamarin Studio がアップデートを促したので、 6にアップデートされてしまい、Unityのプロジェクトが上手く開かなくなった。 Outdated cask: xamarin-studio · Issue #17941 · caskroom/homebrew-cask · GitHub xamarin.ios - From where can I download xam…
https://msdn.microsoft.com/ja-jp/library/hh264221.aspx #if !UNITY_EDITOR_WIN // Make sure our reference framework is 4.0, still the base for Unity if (content.IndexOf("<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>") != -1) { content = Regex.Replace(content, "<TargetFrameworkVersion>v3.5</targetframeworkversion>
www.tcmobile.jp NGUIのローカライズ機能のUILocalizeは便利だが・・。 csv(拡張子は.txt)をいじるたびに再起動? そんな面倒なことしてられっか! UILocalizeEditor.csのOnInspectorGUIメソッドの中にこれを追加して if(GUILayout.Button(new GUIContent(…
https://code.visualstudio.com/Docs/runtimes/unity
git ls-files --others --exclude-standard | grep .meta | sed -e 's/.meta//g' | xargs rmdir;git clean -f のコマンド。 解説 git ls-files --others --exclude-standard が、untrackの一覧が出る。 そして↓コマンドでその中から.metaのを抽出 grep .meta…
Unityは5.3.1f1を使っている。 uFrameやってみる。 Asset Storeの1.6.3.r1のバージョンを使うことにした。 uFrame-1.5.1r2とuFrame-1.6.3r1のUnityパッケージが存在する。 このバージョンがあたらしいuFrame-1.6.3r1を展開してみる。 すると早速大量のエラー…
Unityエキスパート養成読本 Unityエキスパート養成読本[ゲーム開発の現場で役立つノウハウ満載! ] (Software Design plus)作者: 佐藤圭明,村上哲太郎,大塚壮太郎,渡部聡,渡邉俊光,新井隆祥,相良康介,吉田奉正,石黒祐輔,大庭俊介出版社/メーカー: 技術評論社…
string hoge; で宣言して、 this.hoge = GUILayout.TextField(this.hoge, 200); とすると、 NullReferenceException: Object reference not set to an instance of an object UnityEngine.GUI.DoTextField (Rect position, Int32 id, UnityEngine.GUIContent…
http://blogs.unity3d.com/jp/2015/12/01/custom-coroutines/ 1. 疑問 もしWaitForSecondsをtimescaleを0に指定しながら使用したら、(timescaleが0以外に再び戻るまで) 永遠に待ち続けることになるのです。 理由 これはつまりWaitForSeconds に1秒待つよう…
http://wiki.unity3d.com/index.php/Scripts/General から、editとかで編集して新しいページを作る。
Currentとは Unity のコルーチンで結果を受け取る - Qiita StartCoroutineで呼ばれているIEnumeratorメソッド内ではCurrentを返さないとダメらしい。 こちらも参考 Unity入門/コルーチンの待機 - WisdomSoft あとは、関係ないがvoidを返す普通のメソッドでの…
https://kenjin.unity3d.jp/events/show/307 開演、Unity Technologies Japan 大前広樹登壇 サバイバルシューター https://unity3d.com/jp/learn/tutorials/projects/survival-shooter-project ライトとかも入っている。 ・ビルド(Development Build) アセ…
Hogeクラスは何の変哲もないMonoBehaviorの継承でもないふつーのクラス。 シリアライズのため[System.Serializable] [System.Serializable] class Hoge { string bar; } そしてInsppectorを表示していたクラス public class MyMono : MonoBehaviour { [Seria…
どうしてもEditorのOnEnabledが遅くて、普通のMonoBahaviorのAwake()より遅くて困った。 [InitializeOnLoad] //これをつけるとstaticなコストラクタを定義すると呼ばれる. public class Test : Editor // 別にEditorの小クラスでなくても`InitializeOnLoad`…
yield キーワード yield return n; とした。 foreach(object n in GetIterator()) { Debug.Log(n); } ちゃんと数字返るっぽい
IL2CPPに関する軽い話 from Wooram Yang www.slideshare.net 中間言語(Intermediate Language)をC++(CPP)に変換
invoke a method from a Unity Inspector カスタムアトリビュートを作る? using System; // Place this file in any folder that is or is a descendant of a folder named "Scripts" namespace CatchCo { // Restrict to methods only [AttributeUsage(Att…
https://unity3d.com/learn/tutorials/modules/intermediate/live-training-archive/property-drawers-custom-inspectors UnityScriptもなんかある http://answers.unity3d.com/questions/39360/how-to-get-to-the-editor-to-display-a-childs-world.html
RGBの(255, 255, 255)みたいなのを6桁の16進数数字のカラーコードFFFFFFにしたい。 ※'#‘はいらない。 RGB値からHTMLカラーコードに変換する:humming bird を参考。 拡張メソッド // Slice. public static string Slice(this string aString, int num) { retu…