void Awake() { Instance = this; if (Screen.width > Screen.height) { size = Screen.height; } else { size = Screen.width; } joyStickTexture = gameObject.AddComponent <GUITexture> (); joyStickTexture.texture = joyStick; joyStickTexture.color = inactiveColor; var bo = new GameObject("RightBack"); bo.transform.localScale = Vector3.zero; backObj = bo.gameObject.AddComponent <GUITexture> (); backObj.texture = background2D; backObj.color = inactiveColor; rb = gameObject.AddComponent <RightBack> (); rb.con = this; rb.tex = backObj; rf = gameObject.AddComponent <RightFinger> (); gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localScale = Vector3.zero; rf.con = this; rf.tex = joyStickTexture; }
void Clo() { InventoryPart.SetActive(false); InvOpn = false; Information.GetComponent <Text>().text = "Name: \nAmount: \nMass: "; RightFinger.SetActive(true); }
void Clos() { if (Active == true) { Inv.SetActive(false); FireplacePart.SetActive(false); InfoPart.SetActive(true); CtrlPart.SetActive(true); RightFinger.SetActive(true); InventoryScript.InvOpn = false; Hit.collider.gameObject.GetComponent <FirePlaceScript>().Active = false; } }
public void Us() { Ray ray = Cam.ScreenPointToRay(Center); if (Physics.Raycast(ray, out Hit, 3F) && Hit.collider.tag == "Fireplace") { Hit.collider.gameObject.GetComponent <FirePlaceScript>().Active = true; if (Active == true) { Inv.SetActive(true); FireplacePart.SetActive(true); InfoPart.SetActive(false); CtrlPart.SetActive(false); RightFinger.SetActive(false); InventoryScript.InvOpn = true; } } }
void UseInMen() { if (InventoryScript.Inv[chsdCell, 5] == "B") { i = 1; InventoryPart.SetActive(false); RightFinger.SetActive(true); InventoryScript.InvOpn = false; for (int y = 0; y < Buildings.Length; y++) { if (InventoryScript.Inv[chsdCell, 6] == Buildings[y].name) { Bldng = Instantiate(Buildings[y], Loc, Rot); Bldng.transform.SetParent(BldLoc.GetComponent <Transform>().transform); Bldng.SetActive(true); r = y; } } } }
void Invento() { InventoryPart.SetActive(true); InvOpn = true; RightFinger.SetActive(false); }