Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Error!!! NullReferenceException: Object reference not set to an instance of an object

$
0
0
Hello everybody! I want to instantiate a button which it change a path. I create this script: using UnityEngine; using System.Collections; using UnityEngine.UI; using System.IO; using VRStandardAssets.Utils; public class ButtonSelector : MonoBehaviour { [SerializeField] private VRInteractiveItem m_VRInteractiveitem; void OnEnable() { m_VRInteractiveitem.OnClick += CambiaPath; } void OnDisable() { m_VRInteractiveitem.OnClick -= CambiaPath; } //Cambia il path del textureloader public void CambiaPath() { TextureLoader txtloader = (TextureLoader)this.GetComponent (typeof(TextureLoader)); Debug.Log(txtloader.mLocalStorageDirPath); txtloader.mLocalStorageDirPath = txtloader.GetOrigin() + "\\" + this.GetComponentInChildren ().text + "\\"; txtloader.InizioFoto (); } } The problem is when i click the button there is a error written above. what's wrong?

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>