Entries from 2015-06-01 to 1 month

【Unity エラー】CS0161 : コルーチンで"return"がない

コルーチンに設定して、"return"がない。 error CS0161: `SituationManager.DoorOpenWait()': not all code paths return a value public void OpenDoor(){ isDoorOpen = true; print("Open Door"); SituationChara = TempSituation; StartCoroutine(DoorOpe…

【Unity エラー】Android APKビルド "Bundle Identifier"必要

Bundle Identifierが初期値のままではエラーになる。 Bundle Identifier has not been set up correctly com.untiy3D.testなどに変更する。[Unity] Android APK ファイルをビルドする - Unityプロジェクトのビルド

【Unity チュートリアル】プレイヤーのライフゲージ(HP)作成

スライダーのプロパティと連携させて、ライフを作る。 using UnityEngine; using System.Collections; using UnityEngine.UI; public class Life : MonoBehaviour { public GameObject LifeChara; public Slider SliderLife; public GameObject HPname; publ…

文字型Stringを引数にもつ関数を作るときのメモ

呼び出す側に""をつけて、関数の方にはつけない。 void OnSwipeUp(){ print("OnSwipeUp"); ShowInput ("OnSwipeUp"); } void OnSwipeDown(){ print("OnSwipeDown"); ShowInput ("OnSwipeDown"); } void ShowInput(string Stri){ ShowInputText.GetComponent<Text> </text>…

色Vector4

// 赤 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>

GetComponent<TextMesh>().color = Color.blue

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>

【Unity エラー】CS0052 : アクセス修飾子に関するエラー

アクセシビリティーに一貫性がないときにエラーになる。 publicなど確認する。 error CS0052: Inconsistent accessibility: field type `GameOver.Reason' is less accessible than field `GameOver.reason' urashita.com

小数点いくつまで表示するか決める

Parent.transform.FindChild("TimerGameOver").GetComponent<TextMesh>().text ="" + TimeCurrent.ToString("f1"); Unity(JavaScript)で小数の桁数を指定して表示 | kankaz.net</textmesh>

【Unity エラー】Androidビルド実行時のエラー

ケース1 エラー内容 Unable to sign application; please provide passwords! 解決方法 "Player Setting", "Key", "alias" を「Unsigned」にすることでエラー解消。 UnityのAndroidビルド時にkeystoreのパスワードを毎回要求しないようにする - テラシュー…

Buttonプレス時にSpriteを変えたい時

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>…

Spriteの設定

・Filter Mode 引き伸ばした時のぼかし方の設定。 ピクセルアートにしたい時、Pointにする。・Generate Mip Maps 2Dのときは、オフにする。テクスチャで設定できる項目 - テラシュールブログtsubakit1.hateblo.jp Unity テクスチャ(Texture 2D)の基本設定 -…