public GameObject DevolverGO(string boto) { GameObject botin = GameObjectFinder(boto); NumInt n = botin.GetComponent <NumInt>(); int e = n.numarray; Debug.Log(Inventario [e]); //GameObject ob = GameObject.Find (Inventario [e]); //GameObject ob = holdersGO [e]; GameObject ob = GameObjectFinder(Inventario [e]); return(ob); }
public void Something(UnityEngine.UI.Button btnn) { //ejecuto cuando aprieto boton normal inventario GameObject global = GameObject.Find("ScriptGlobal"); Global sglob = global.GetComponent <Global> (); NumInt numint = btnn.GetComponent <NumInt> (); int Numeroinv = numint.numarray; sglob.Selected = sglob.Inventario [Numeroinv]; sglob.Resolve(btnn.name); }
public void Resolve(string nomm) { if (Orbit) { GameObject objeto = DevolverGO(nomm); Debug.Log(nomm + "0043"); Debug.Log(objeto.name + "2111"); if (nowOrbitingName != "") { GameObjectFinder(nowOrbitingName).SetActive(false); } nowOrbitingName = ""; nowOrbitingName = objeto.name; objeto.gameObject.SetActive(true); GameObject cam = GameObject.Find("CamaraOrbit"); Camera camara = cam.GetComponent <Camera> (); camara.GetComponent <Camera> ().depth = 5; GameObject o = GameObject.Find("Orbiting"); Debug.Log(objeto.transform.position.ToString()); Debug.Log(o.transform.position.ToString()); objeto.transform.position = o.transform.position; //objeto.GetComponent<Renderer>().enabled=true; Debug.Log(objeto.gameObject.transform.position.ToString() + "2058"); Messenger.Message("Haz click derecho " + "\n" + "para salir", 0.01f, Color.yellow, true, false); } if (Combinar) { if (contarobj == 1) { GameObject bot = GameObject.Find(nomm); NumInt numint = bot.GetComponent <NumInt>(); int nume = numint.numarray; //bot = GameObject.Find(Combinado); bot = GameObjectFinder(Combinado); numint = bot.GetComponent <NumInt>(); int nume2 = numint.numarray; string nuevoobjeto = Unite(Inventario[nume2], Inventario[nume]); if (nuevoobjeto != "") { //borro imagen, deshabilito botones Inventario[nume] = ""; Inventario[nume2] = ""; //GameObject Inventario2 = GameObject.Find (Combinado); GameObject Inventario2 = GameObjectFinder(Combinado); UnityEngine.UI.Button btn = Inventario2.GetComponent <UnityEngine.UI.Button> (); btn.interactable = false; btn.image.sprite = default(Sprite); //Inventario2 = GameObject.Find (nomm); Inventario2 = GameObjectFinder(nomm); btn = Inventario2.GetComponent <UnityEngine.UI.Button> (); btn.interactable = false; btn.image.sprite = default(Sprite); Selected = ""; //pego //GameObject objeton = GameObject.Find(nuevoobjeto); GameObject objeton = GameObjectFinder(nuevoobjeto); //GameObject Inventario1 = GameObject.Find("Inventario"); GameObject Inventario1 = GameObjectFinder("Inventario"); Clicked getspr = objeton.GetComponent <Clicked>(); Inven codigo = Inventario1.GetComponent <Inven> (); Sprite sprite = getspr.sprite; objetoarr(nuevoobjeto); codigo.AddGO(sprite); getspr.visible = false; contarobj = 0; Combinado = ""; Combinar = false; } else { Combinar = false; Combinado = ""; contarobj = 0; } } else { contarobj++; Combinado = nomm; } } }