public void setData(InterfaceScript _master, ObjectInSpace _owner, ObjectInSpace _target, InterfaceOverviewItemScript _interfaceOverviewItem) { master = _master; owner = _owner; target = _target; interfaceOverviewItem = _interfaceOverviewItem; }
public void overviewDropdownAdd(InterfaceOverviewItemScript interfaceOverviewItem, PointerEventData eventData) { overviewDropdownDestroy(); overviewDropdown = ((GameObject)Instantiate(overviewDropdownPrefab, interfaceOverviewItem.gameObject.transform.position, interfaceOverviewItem.gameObject.transform.rotation, gameObject.transform)).GetComponent <InterfaceOverviewDropdownScript>(); overviewDropdown.setData(this, interfaceOverviewItem.getOwner(), interfaceOverviewItem.getTarget(), interfaceOverviewItem); overviewDropdown.gameObject.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); Vector3 pos = new Vector3(eventData.pressPosition.x, eventData.pressPosition.y, overviewDropdown.gameObject.transform.position.z); pos = new Vector3(pos.x, pos.y - (overviewDropdown.gameObject.GetComponent <RectTransform>().sizeDelta.y *0.6f), pos.z); overviewDropdown.gameObject.transform.position = pos; }
private void addOverviewItemToOverview(ObjectInSpace target) { GameObject overviewItem = (GameObject)Instantiate(overviewItemPrefab, overviewTransform.position, overviewTransform.rotation, overviewTransform); InterfaceOverviewItemScript overviewItemScript = overviewItem.GetComponent <InterfaceOverviewItemScript>(); if (overviewItemScript) { overviewItemScript.setData(this, owner, target); overviewItemList.Add(overviewItemScript); } }
private void overviewItemDestroy(int index) { InterfaceOverviewItemScript item = overviewItemList[index]; if (item) { item.destroy(); } else { overviewItemList.RemoveAt(index); } }
public void addTarget(ObjectInSpace target, InterfaceOverviewItemScript interfaceOverviewItem) { bool addTargetSucess = owner.addTarget(target); if (addTargetSucess) { GameObject targetTile = (GameObject)Instantiate(targetTilePrefab, targetTilesHolder.position, targetTilesHolder.rotation, targetTilesHolder); InterfaceTargetTileScript targetTileScript = targetTile.GetComponent <InterfaceTargetTileScript>(); if (targetTileScript) { targetTileScript.setData(this, owner, target, interfaceOverviewItem); interfaceOverviewItem.setColorTarget(); targetTilesList.Add(targetTileScript); refreshTargetTiles(); } } }
public void InterfaceOverviewItemMouseLeave(InterfaceOverviewItemScript interfaceOverviewItem) { interfaceOverviewItem.setColorNormal(); }
public void InterfaceOverviewItemMouseEnter(InterfaceOverviewItemScript interfaceOverviewItem) { interfaceOverviewItem.setColorHighlighted(); }