Entries from 2015-05-01 to 1 month
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));
リストの要素の追加は、Addを使う。 public List<GameObject> Obj; void Start () { for (int i = 1; i <=NumObj; i++){ Obj.Add(GameObject.Find("Obj"+i)); } } UnityでListを使いたい - Qiitaqiita.com</gameobject>
音源 BGM素材 – ポケットサウンド – フリー効果音素材・BGMダウンロード G-Sound 全曲無料・フリー音楽素材/魔王魂 Download 100,000 Royalty-Free Music, Sound Effects, and Loops 背景 商用可、オシャレ質感系Photoshopパターン素材を無料公開している「S…
難易度表記の素材満載。 ネット世代の雑評論 ゲームの難易度表記の序列 横文字編。
1. Draw Shapes for 2D Physics Game https://www.assetstore.unity3d.com/jp/#!/content/17955 デモ Unity Web Player | Draw Shapes for 2D Physic Game 2. Uni2D 一つのスプライトから、アニメーションを作成できる。 https://www.assetstore.unity3d.com…
Updateでオブジェクト生成のメソッドを書くより、StartCoroutineを使って生成する方が早くなる。(理由は・・・)Coroutineとwhileを使ってオブジェクトを生成する。 using UnityEngine; using System.Collections; public class Interpolator3 : MonoBehavi…
error CS0126: An object of a type convertible to `bool' is required for the return statement 文中のreturn;をyield break;に修正すると、エラーがなくなる。hwks.hatenadiary.jp Unityのコルーチンの使い方をまとめてみた - WonderPlanet DEVELOPER BL…
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」のところで、レイヤーの影響範囲を設定してあげる。
12px.com github.com
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);
Unityでプラットフォームごとに分岐を作る - ことばアルバムis4cafe.hatenablog.com
Dots:「繋ぎ」を追求するゲーム - Google Play の Android アプリ gigazine.net
using UnityEngine; using System.Collections; using UnityEngine.UI; public class SplashScreenScript : MonoBehaviour { public Image myPanel; float fadeTime = 2f; Color colorToFadeTo; void Start() { colorToFadeTo = new Color (1f, 1f, 1f, 1f);…
if (Input.GetKeyDown(KeyCode.A)){ PlayerPrefs.DeleteAll(); } Unityで、保存データ全消しのデバッグ用ボタンを配置するblog.k-kansei.com