2014-11-13から1日間の記事一覧

Unityでタッチした位置にパーティクルをInstantiateする

ゲームでよく見るあれです。 using UnityEngine; using System.Collections; public class ParticleCamera : MonoBehaviour { public GameObject particle; // Use this for initialization void Start () { } // Update is called once per frame void Upda…

Unity 4.6 uGUIのスプライトを動的にResources以下のもので置き換える

//Canvasの子供にImageコンポネントが付いたUIがあるとする GameObject.Find ("image").GetComponent<Image> ().sprite = Resources.Load("Images/Cards/0001", typeof(Sprite)) as Sprite; // typeof(Sprite)が必要 // 一方、as Textureのときはtypeof(Sprite)は不</image>…