Unity 全般
親オブジェクトのスケールを変化させても子オブジェクトを変化させたくない場合 - テラシュールブログtsubakit1.hateblo.jp
例1(問題有の可能性) //(名前空間の定義) //using UnityEngine.Events; if((SituationCreater2.instance.Count) < 10){ button = ObjectFromToilet.GetComponent<Button> (); if (n < 1){ // ObjectFromToilet.GetComponent<Image>().sprite = null; }else if(1 < n && n </image></button>…
if ((Input.touchCount >0&& Input.GetTouch (0).phase == TouchPhase.Began )|| Input.GetMouseButtonDown(0)) { http://albatrus.com/main/unity/6520 UnityでAndroidのタッチ操作 - tanaka's Programming Memoam1tanaka.hatenablog.com
「BuildSetting」「PlayerSetting」「Resolution and Presentation」「Default Orientation」 縦向き:Portrait 横向き:Landscape Left起動時の画面の向きを固定する | nekosukoブログnekosuko.jp
コルーチンに設定して、"return"がない。 error CS0161: `SituationManager.DoorOpenWait()': not all code paths return a value public void OpenDoor(){ isDoorOpen = true; print("Open Door"); SituationChara = TempSituation; StartCoroutine(DoorOpe…
// 赤 SliderLife.gameObject.transform.FindChild("FillArea").GetComponentInChildren<Image>().color = new Vector4(0, 0, 1, 1); // 青 SliderLife.gameObject.transform.FindChild("FillArea").GetComponentInChildren<Image>().color = new Vector4(1, 0, 0, 1);</image></image>
Case[Type].transform.FindChild("TimerGameOver"). gameObject.GetComponent<TextMesh>().color = Color.blue; 3D Text - How to change colour - Doesn't seem to work - Unity Answers</textmesh>
TransitionをSprite Swapに設定する。Unity - マニュアル: 遷移オプションdocs.unity3d.com
SituationManager tempSituationManager; GameObject Parent = hit2.transform.parent.gameObject; tempSituationManager = Parent.transform.GetComponentInChildren<SituationManager>(); Unityの親子。★transform.parent とgameObject - 149cmプログラマ-unity3d.hatenablog</situationmanager>…
・Filter Mode 引き伸ばした時のぼかし方の設定。 ピクセルアートにしたい時、Pointにする。・Generate Mip Maps 2Dのときは、オフにする。テクスチャで設定できる項目 - テラシュールブログtsubakit1.hateblo.jp Unity テクスチャ(Texture 2D)の基本設定 -…
void TouchFingerInput(){ if (Input.touchCount > 0){ Touch touch = Input.touches[0]; // フェイズで管理できる。 switch(touch.phase){ // タッチ開始場所 case TouchPhase.Began: OnStartDrag(touch.position); break; // タッチ終了場所 case TouchPha…
// ポーズ画面静止状態にする public void PopPaused(){ GameManager.instance.Play = false; PausedParent.SetActive(true); Time.timeScale = 0; } public void HidePaused(){ GameManager.instance.Play = true; PausedParent.SetActive(false); // 元の…
【Unity 2D】GameObjectにタッチ処理を実装するalbatrus.com Unity - 入力 / Inputpsm.playstation.net
//オブジェクトの孫要素を取得する。 EndScreen.transform.FindChild("ScoreParent").transform.FindChild("Score").GetComponent<Text>().text =""+ (SituationCreater.instance.Count); // わざわざFindChildを使う非有ようがないのであれば、以下でよい。 GameO</text>…
UIでなくて、文字を表示する方法 //public string text ScenePrefabs[Type].transform.FindChild("OddNumberWC").GetComponent<TextMesh>().text = "" + (Count + ScenePrefabs.Length); GameObject上にカウントダウンテキスト表示するにはja.stackoverflow.com Unity</textmesh>…
unity_get_screen_size - FreeStyleWiki
o.transform.FindChild("Canvas").GetComponent<Canvas>().worldCamera = targetCamera; //例2 //メインカメラの最初の名前は、「Main Camera」になっている。 //「MainCamera」に変更しないといけない。 CanvasSituation.GetComponent<Canvas> ().worldCamera = GameObject</canvas></canvas>…
Rayを使って、最初と最後の入力の位置を獲得して、自分でRayを定義してあげる。 (スワイプの取得方法で、他にいい方法があれば教えて欲しいです。) using UnityEngine; using System.Collections; using UnityEngine.UI; public class FlickManager : Mono…
//y軸との角度を取得する。 float angle =Vector2.Angle(new Vector2(0,1),UnitVector); Vector3クラスのメモ - unity学習帳unitylab.wiki.fc2.com
iTweenを使って、色を変化させる。 iTween.ColorTo(Background_White,iTween.Hash("r",1f, "g",1f, "b",1f, "time",0.5f));
Updateでオブジェクト生成のメソッドを書くより、StartCoroutineを使って生成する方が早くなる。(理由は・・・)Coroutineとwhileを使ってオブジェクトを生成する。 using UnityEngine; using System.Collections; public class Interpolator3 : MonoBehavi…
UnitVector = ( Obj2.transform.position - Obj1.transform.position ).normalized; 3D+ Unity 二点間のベクトル3dplus.blog.fc2.com
public static float Distance(Vector2 a, Vector2 b); ActionScript入門Wiki - Unity - (Vector3)二点間距離を求める Unity - スクリプティング API: Vector2.Distancedocs.unity3d.com
2Dでの「Camera.main.ScreenToWorldPoint」の扱いに困った。 これは、「スクリーン座標をワールド座標に変換する関数」であるが、これを2Dで使うたいとき、カメラのプロパティ「Projection」を「Orthographic」(2D用)に設定してあげなければならない。082…
Rigidbodyコンポーネントを持つオブジェクトを、Colliderコンポーネントを持つコンポーネントの上に生成すると、反発する。もし共存させたい場合は、レイヤーを設定して、「PlayerSetting」「Physics」のところで、レイヤーの影響範囲を設定してあげる。
UntiyでWebページを開きたい時に使う。 public void ShareButton(){ Application.OpenURL("https://www.google.co.jp"); } Unity3D:アプリのレビューページを直接開く - devlog [naru design] Unityアプリからソーシャルメディアと連携する - Qiitaqiita.com…
ケース1 エラー内容 error CS0029: Cannot implicitly convert type `UnityEngine.Transform' to `UnityEngine.GameObject' 修正前 public GameObject ClearScreen; GameObject ClearHideButton; public void ClearStage(){ ClearHideButton = ClearScreen.…
再度シーンを読み込むことによって、リロードすることができる。 オブジェクトの初期状態を変数に入れておいて、元に戻すという手間なことをする必要がない。 Application.LoadLevel("Stage1"); Unity C# リロード(初期状態にもどる)的な処理 - Qiitaqiita…
複数のステージを作る際に、Canvasをプレハブで再利用するとき、EventSystemを子にしておく。
親を設定する。 cameoChild.transform.SetParent(ListParent.transform);