public override void Close() { base.Close(); creationLibrary.updateAsset -= UpdateAsset; creationLibrary.RequestClose(); editMain.modelLoadingObject.SetActive(false); }
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(); }