コード例 #1
0
 public void setData(InterfaceScript _master, ObjectInSpace _owner, ObjectInSpace _target, InterfaceOverviewItemScript _interfaceOverviewItem)
 {
     master = _master;
     owner  = _owner;
     target = _target;
     interfaceOverviewItem = _interfaceOverviewItem;
 }
コード例 #2
0
    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;
    }
コード例 #3
0
    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);
        }
    }
コード例 #4
0
    private void overviewItemDestroy(int index)
    {
        InterfaceOverviewItemScript item = overviewItemList[index];

        if (item)
        {
            item.destroy();
        }
        else
        {
            overviewItemList.RemoveAt(index);
        }
    }
コード例 #5
0
    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();
            }
        }
    }
コード例 #6
0
 public void InterfaceOverviewItemMouseLeave(InterfaceOverviewItemScript interfaceOverviewItem)
 {
     interfaceOverviewItem.setColorNormal();
 }
コード例 #7
0
 public void InterfaceOverviewItemMouseEnter(InterfaceOverviewItemScript interfaceOverviewItem)
 {
     interfaceOverviewItem.setColorHighlighted();
 }