using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Raumgleiter.RGDKDevLab { public class MtexSceneHandler : MonoBehaviour { public Button ButtonOne, ButtonTwo, ButtonThree; public GameObject Cube; //public Dropdown DDCurrentMaterials; public List AllMaterials; public string MaterialToChange; // Use this for initialization void Start () { ButtonOne.onClick.AddListener(delegate { GetModel(); }); ButtonTwo.onClick.AddListener(delegate { StartMtexDownloader(); }); ButtonThree.onClick.AddListener(delegate { GetAllMaterials(); }); //DDCurrentMaterials.onValueChanged.AddListener(delegate { MakeItCurrent(); }); } private void MakeItCurrent() { //Debug.Log(AllMaterials[DDCurrentMaterials.value]); //MaterialToChange = AllMaterials[DDCurrentMaterials.value]; } private void GetAllMaterials() { var Building = GameObject.Find("Painter").GetComponent().GetThisGameObject(); AllMaterials = GameObject.Find("Painter").GetComponent().GetAllMaterials(Building); // DDCurrentMaterials.ClearOptions(); // DDCurrentMaterials.AddOptions(AllMaterials); } private void StartMtexDownloader() { GameObject.Find("EventSystem").GetComponent().StartMtexDownloader(); } private void GetModel() { GameObject.Find("Painter").GetComponent().LoadProject(); } } }