コード例 #1
0
ファイル: EditMain.cs プロジェクト: zachary2234/gamebuilder
    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);
        }
    }
コード例 #2
0
ファイル: MoveTool.cs プロジェクト: zachary2234/gamebuilder
    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();
    }
コード例 #3
0
    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;
    }