private void ParentCheck() { VoosActor actor = GetSingleTargetActor(); if (inputControl.GetButtonDown("Parent") && actor != null) { Debug.Log( "parenting " + actor.GetDisplayName() + " to " + (hoverActor != null ? hoverActor.GetDisplayName() : "(nothing)")); bool autosetParent = PlayerPrefs.GetInt("moveTool-autosetSpawn", 1) == 1 ? true : false; MoveToolSettings.SetCurrentParentForActor(actor, hoverActor, undoStack, autosetParent); } }
public override void Launch(EditMain _editmain) { base.Launch(_editmain); gizmoSelectionFeedback.Setup(); toolEffectController.originTransform = emissionAnchor; toolEffectController.SetTint(editMain.GetAvatarTint()); moveToolSettings = Instantiate(moveToolSettingsPrefab, editMain.topLeftAnchor); moveToolSettings.Setup(); dummyTransform = new GameObject("MoveDummyTransform").transform; dummyTransform.SetParent(transform); LoadToolMemory(); ForceUpdateTargetActor(); }
public void SelectActor(System.Action <VoosActor> callback) { if (objectSelectorTool != null) { editMain.RemoveToolFromList(objectSelectorTool); } objectSelectorTool = editMain.AppendTool <ObjectSelectorTool>(selectorToolFab); // Hack because CanvasRender can't be disabled ... maybe we can add an animation here? assetUI.pickerOverlay.SetActive(true); MoveToolSettings settings = this; System.Action <VoosActor> moveToolCallback = (actor) => { hierarchyPanelController.SetSelectCallback(null); editMain.RemoveToolFromList(settings.objectSelectorTool); assetUI.pickerOverlay.SetActive(false); Debug.Log((actor != null ? actor.GetDisplayName() : "nothing") + " " + "selected"); callback(actor); }; hierarchyPanelController.SetSelectCallback(moveToolCallback); objectSelectorTool.OnActorSelect = moveToolCallback; }