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?
↧