void Update() { int actorCount = editMain.GetTargetActorsCount(); bool onlyOne = actorCount == 1; assetUI.currentFrame.SetActive(GetShowSettings() && onlyOne); assetUI.toolModeFrame.gameObject.SetActive(GetShowSettings() && onlyOne); assetUI.spawnFrame.SetActive(GetShowSettings() && onlyOne); assetUI.offsetsToggle.gameObject.SetActive(GetShowSettings() && onlyOne); assetUI.offsetFrame.SetActive(GetShowSettings() && GetShowOffsets() && onlyOne); assetUI.noSelection.SetActive(GetShowSettings() && actorCount == 0); assetUI.multiSelection.SetActive(GetShowSettings() && actorCount > 1); if (inputControl.GetButton("Snap")) { assetUI.snapToggle.isOn = true; } else if (assetUI.snapToggle.isOn != snapping) { assetUI.snapToggle.isOn = snapping; } if (onlyOne) { ActorUpdate(editMain.GetSingleTargetActor()); } else { assetUI.header.text = "Rotate Tool"; } UpdateNavigation(); }
void NullActorRefresh() { bool noActors = editMain.GetTargetActorsCount() == 0; nothingSelectedPrompt.gameObject.SetActive(noActors); multipleSelectedPrompt.gameObject.SetActive(!noActors); }
void Update() { int actorCount = editMain.GetTargetActorsCount(); bool onlyOne = actorCount == 1; assetUI.currentFrame.SetActive(GetShowSettings() && onlyOne); assetUI.snapToggle.gameObject.SetActive(GetShowSettings() && onlyOne); assetUI.localSpaceToggle.gameObject.SetActive(GetShowSettings() && onlyOne); assetUI.offsetsToggle.gameObject.SetActive(GetShowSettings() && onlyOne); assetUI.spawnFrame.SetActive(GetShowSettings() && onlyOne); assetUI.offsetFrame.SetActive(GetShowSettings() && GetShowOffsets() && onlyOne); foreach (GameObject go in assetUI.parentFrames) { go.SetActive(GetShowSettings() && onlyOne); } assetUI.noSelection.SetActive(GetShowSettings() && actorCount == 0); assetUI.multiSelection.SetActive(GetShowSettings() && actorCount > 1); assetUI.snapToggle.onValueChanged.RemoveListener(SetSnappingSetting); assetUI.snapToggle.isOn = inputControl.GetButton("Snap") || snapping; assetUI.snapToggle.onValueChanged.AddListener(SetSnappingSetting); if (onlyOne) { ActorUpdate(editMain.GetSingleTargetActor()); } else { assetUI.header.text = "Move Tool"; } UpdateNavigation(); }