コード例 #1
0
    void Update()
    {
        if (moreButton.IsSelected() != creationLibrary.IsOpenedOrOpening())
        {
            moreButton.SetSelect(creationLibrary.IsOpenedOrOpening());
        }

        //shutting off the Q/E being tied to tooltips

        /*  if (editMain.ShowTooltips() != toolbarTooltips[0].activeSelf)
         * {
         * foreach (GameObject go in toolbarTooltips)
         * {
         *   go.SetActive(editMain.ShowTooltips());
         * }
         * } */
    }
コード例 #2
0
    public void Setup(CreationLibrarySidebar creationLibrary)
    {
        this.creationLibrary = creationLibrary;
        for (int i = 0; i < ASSET_COUNT; i++)
        {
            int index = i;
            toolbarItems[i].SetSelect(false);
            toolbarItems[i].GetComponent <UnityEngine.UI.Button>().onClick.AddListener(() => OnMenuItemClick?.Invoke(index));
        }

        assetObjectsParent = new GameObject("assetObjects").transform;
        assetToolbarAssets = new ActorableSearchResult[ASSET_COUNT];

        moreButton.GetComponent <UnityEngine.UI.Button>().onClick.AddListener(() =>
        {
            if (creationLibrary.IsOpenedOrOpening())
            {
                creationLibrary.RequestClose();
            }
            else
            {
                creationLibrary.RequestOpen();
            }
        });
        Util.FindIfNotSet(this, ref assetSearch);

        OnMenuItemClick = SelectIndex;

        assetToolbarRenderables = new GameObject[ASSET_COUNT];
        assetToolbarObjects     = new GameObject[ASSET_COUNT];
        for (int i = 0; i < assetToolbarObjects.Length; i++)
        {
            assetToolbarObjects[i] = new GameObject("new tool item");
            assetToolbarObjects[i].transform.SetParent(assetObjectsParent);
            assetToolbarObjects[i].transform.localPosition = Vector3.zero;
            assetToolbarObjects[i].transform.localRotation = Quaternion.identity;
            assetToolbarObjects[i].transform.localScale    = new Vector3(1f, 1f, 1f);
            assetToolbarObjects[i].SetActive(false);
        }

        //load the toolbar with goodstuff by hand for now
        LoadDefaultAssets();
    }