Beispiel #1
0
    private void UpdateCamera()
    {
        RuntimeInputConfiguration inputConfig = inputController.GetRuntimeInputConfig();
        float camHorizontal = inputConfig.GetBinding(InputBindingName.GAMEPLAY_CAMHORIZONTAL).Value;
        float camVertical   = inputConfig.GetBinding(InputBindingName.GAMEPLAY_CAMVERTICAL).Value;

        if (updateCameraAction != null)
        {
            updateCameraAction(camHorizontal, camVertical, transform.position, target ? target.transform.position : Vector3.zero);
        }
    }
Beispiel #2
0
    private void InitInputBindings()
    {
        RuntimeInputConfiguration runtimeInput = inputController.GetRuntimeInputConfig();
        InputBinding equipBinding = runtimeInput.GetBinding(InputBindingName.PLAYER_INV_USEOREQUIP);

        equipBinding.Action.Start = EquipOrUseSelectedItem;
    }
Beispiel #3
0
    private void InitInputController()
    {
        RuntimeInputConfiguration inputConfig = inputController.GetRuntimeInputConfig();
        InputBinding horizontalBinding        = inputConfig.GetBinding(InputBindingName.GAMEPLAY_HORIZONTAL);
        InputBinding verticalBinding          = inputConfig.GetBinding(InputBindingName.GAMEPLAY_VERTICAL);
        InputBinding interactBinding          = inputConfig.GetBinding(InputBindingName.GAMEPLAY_INTERACT);
        InputBinding attackBinding            = inputConfig.GetBinding(InputBindingName.GAMEPLAY_ATTACK);
        InputBinding primarySkillBinding      = inputConfig.GetBinding(InputBindingName.GAMEPLAY_PRIMARY_SKILL);
        InputBinding secondarySkillBinding    = inputConfig.GetBinding(InputBindingName.GAMEPLAY_SECONDARY_SKILL);
        InputBinding toggleTargetingBinding   = inputConfig.GetBinding(InputBindingName.GAMEPLAY_TOGGLE_TARGETING);
        InputBinding nextTargetBinding        = inputConfig.GetBinding(InputBindingName.GAMEPLAY_NEXT_TARGET);

        horizontalBinding.Action.Start = () => { blackboard.Set <float>(BlackboardKey.Horizontal, horizontalBinding.Value); };
        verticalBinding.Action.Start   = () => { blackboard.Set <float>(BlackboardKey.Vertical, verticalBinding.Value); };

        interactBinding.Action.Start = () => interactor.Interact();

        attackBinding.Action.Start = () => {
            bool attackFlag = blackboard.Get <bool>(BlackboardKey.AttackingFlag);
            if (attackFlag)
            {
                blackboard.Set <bool>(BlackboardKey.NextAttackFlag, true);
            }
            else
            {
                blackboard.Set <bool>(BlackboardKey.AttackingFlag, true);
            }
        };

        primarySkillBinding.Action.Start = () => {
            bool skillFlag = blackboard.Get <bool>(BlackboardKey.SkillFlag);
            skillController.SetCurrentSkill(0);
            if (!skillFlag && skillController.CanUseCurrentSkill())
            {
                EntitySkillInfo skill = skillController.CurrentSkill.SkillInfo;
                blackboard.Set <string>(BlackboardKey.AnimTrigger, skill.MetaData.AnimTrigger);
                blackboard.Set <bool>(BlackboardKey.SkillFlag, true);
            }
        };

        secondarySkillBinding.Action.Start = () => {
            bool skillFlag = blackboard.Get <bool>(BlackboardKey.SkillFlag);
            skillController.SetCurrentSkill(1);
            if (!skillFlag && skillController.CanUseCurrentSkill())
            {
                EntitySkillInfo skill = skillController.CurrentSkill.SkillInfo;
                blackboard.Set <string>(BlackboardKey.AnimTrigger, skill.MetaData.AnimTrigger);
                blackboard.Set <bool>(BlackboardKey.SkillFlag, true);
            }
        };

        toggleTargetingBinding.Action.Start = () => { ToggleTargeting(); };
        nextTargetBinding.Action.Start      = () => { GetNextTarget(); };
    }
Beispiel #4
0
    private void InitInputBindings()
    {
        RuntimeInputConfiguration runtimeConfig = inputController.GetRuntimeInputConfig();
        InputBinding pauseBinding = runtimeConfig.GetBinding(InputBindingName.TOGGLE_PAUSE);

        pauseBinding.Action.Start = () => {
            PauseState pauseState = currentPauseState == PauseState.UnPaused || currentPauseState == PauseState.ForcePaused ? PauseState.Paused : PauseState.UnPaused;
            TogglePause(pauseState);
        };
    }
    public override void SetDefaultBindings(RuntimeInputConfiguration runtimeConfig)
    {
        InputBinding horizontalBinding      = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_HORIZONTAL);
        InputBinding verticalBinding        = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_VERTICAL);
        InputBinding attackBinding          = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_ATTACK);
        InputBinding camHorizontal          = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_CAMHORIZONTAL);
        InputBinding camVertical            = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_CAMVERTICAL);
        InputBinding interactBinding        = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_INTERACT);
        InputBinding toggleTargetingBinding = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_TOGGLE_TARGETING);
        InputBinding nextTargetBinding      = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_NEXT_TARGET);
        InputBinding primarySkillBinding    = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_PRIMARY_SKILL);
        InputBinding secondarySkillBinding  = runtimeConfig.GetBinding(InputBindingName.GAMEPLAY_SECONDARY_SKILL);

        horizontalBinding.Copy(this.horizontalBinding);
        verticalBinding.Copy(this.verticalBinding);
        attackBinding.Copy(this.attackBinding);
        camHorizontal.Copy(this.camHorizontalBinding);
        camVertical.Copy(this.camVerticalBinding);
        interactBinding.Copy(this.interactBinding);
        toggleTargetingBinding.Copy(this.toggleTargetingBinding);
        nextTargetBinding.Copy(this.nextTargetBinding);
        primarySkillBinding.Copy(this.primarySkillBinding);
        secondarySkillBinding.Copy(this.secondarySkillBinding);
    }
Beispiel #6
0
    public override void SetDefaultBindings(RuntimeInputConfiguration runtimeConfig)
    {
        InputBinding equipBinding = runtimeConfig.GetBinding(InputBindingName.PLAYER_INV_USEOREQUIP);

        equipBinding.Copy(this.equipBinding);
    }
Beispiel #7
0
    public override void SetDefaultBindings(RuntimeInputConfiguration runtimeConfig)
    {
        InputBinding pauseBinding = runtimeConfig.GetBinding(InputBindingName.TOGGLE_PAUSE);

        pauseBinding.Copy(this.pauseBinding);
    }