Resources.Load()– tag –
-
C#
【Unity】PrefabをGameObject.Instantiate(Resources.Load())で読み込もうとして、ArgumentException: The thing you want to instantiate is null.
今日のエラー prefabをロードしようとすると、返り値がNullになった。 さらにNullから参照しようとしたため、Object reference not set to an instance of an object エラーとなった。 コード GameObject go = Instantiate(Resources.Load ("hoge")as Game... -
uGUI
【Unity】Image(Script)のSourceImageを変更する
今日のメモ ランタイム中にSourceImageを変更する。 Image.material.mainTexture Texture texture = Resources.Load("image path") as Texture; Image img = GameObject.Find("Canvas/Panel/***").GetComponent(); img.material.mainTexture = texture; Im... -
Unity
【Unity】テキストファイルを読み込もうとすると、ArgumentException: The thing you want to instantiate is null.
今日のエラー テキストをロードしようとすると、返り値がNullになった。 さらにNullから参照しようとしたため、Object reference not set to an instance of an object エラーとなった。 コード public static string FilePath = "Text/text"; public stat... -
uGUI
【Unity】M+FONTS(.ttfファイル)をUnityで使用する
フリーに使用できるM+FONTSをUnityで表示させるところまでのメモ。 前提となる知識 フォントファイルの形式 フォントファイルは、.ttf形式か.otf形式でUnityにインポートする必要がある。 フォントファイルの配置先 Assets/Fonts配下に配置する必要がある... -
Unity
【Unity】ImageのテクスチャをResources.Load()で読み込んだテクスチャに変更する
! 新しい投稿を参照してください ! Image img = GameObject.Find("Canvas/Panel/***").GetComponent(); img.material.mainTexture = Resources.Load("image path") as Texture; これだけでImageのテクスチャをResources.Load()で読み込んだテクスチャ...
1
