public void OnPointerUp(PointerEventData eventData) { Screen.Dragging = false; ItemImage.transform.SetParent(transform); Screen.CurrentlyDragging = null; if (Screen.DraggingOver) { int pos = Screen.DraggingOver.id; if (Screen.DraggingOver.ItemRepresenting && ItemRepresenting) { Screen.DraggingOver.ItemRepresenting.InventoryPosition = ItemRepresenting.InventoryPosition; } Screen.DraggingOver.ItemImage.transform.position = Screen.DraggingOver.firstPostion; ItemImage.transform.position = firstPostion; if (ItemRepresenting) { ItemRepresenting.InventoryPosition = pos; } Screen.SetInventoryVisually(Screen.Inventory); } else { ItemImage.transform.position = firstPostion; Screen.SetInventoryVisually(Screen.Inventory); } }
public void UpdateInventory() { GameObject equip = GameObject.FindGameObjectWithTag("Equipper"); if (equip) { InventoryScreen screen = equip.GetComponent <InventoryScreen>(); if (screen) { screen.SetInventoryVisually(this); } } }
void Update() { if (Input.GetButtonDown("Menu")) { if (CST.activeSelf) { Screen.Reset(); CST.SetActive(false); AudioSource.PlayClipAtPoint(MenuClosed, Camera.main.transform.position); } else { CST.SetActive(true); AudioSource.PlayClipAtPoint(MenuOpen, Camera.main.transform.position); if (GameObject.FindGameObjectWithTag("Equipper").GetComponent <InventoryScreen>()) { InventoryScreen screen = GameObject.FindGameObjectWithTag("Equipper").GetComponent <InventoryScreen>(); screen.SetInventoryVisually(Inv); } } } }