Beispiel #1
0
 /// <summary>
 ///     Raises the <see cref="PickUp" /> event.
 /// </summary>
 /// <param name="e">An <see cref="PlayerEventArgs" /> that contains the event data. </param>
 public virtual void OnPickUp(PlayerEventArgs e)
 {
     PickUp?.Invoke(this, e);
 }
Beispiel #2
0
 /// <summary>
 ///     Raises the <see cref="PickUp" /> event.
 /// </summary>
 /// <param name="e">An <see cref="PickUpPickupEventArgs" /> that contains the event data. </param>
 public virtual void OnPickUp(PickUpPickupEventArgs e)
 {
     PickUp?.Invoke(this, e);
 }
Beispiel #3
0
 protected virtual void OnPickUp(GameLogEventArgs l)
 {
     PickUp?.Invoke(this, l);
 }
Beispiel #4
0
    // This is probably not a monobehaviour, hence it needs to be updated manually
    // Either by player class or some sort InputControllerManager
    public void UpdateController()
    {
        if (Input.GetButtonDown(jumpKeyName))
        {
            Jump?.Invoke();
        }

        //fire input
        float rightTriggerValue = Input.GetAxisRaw(RTAxisName);

        if (rightTriggerValue > triggerDeadzone && fireEventTriggered == false)
        {
            Fire?.Invoke();
            fireEventTriggered = true;
        }
        else if (rightTriggerValue < triggerDeadzone)
        {
            fireEventTriggered = false;
        }

        //focus input
        if (Input.GetAxisRaw(LTAxisName) > triggerDeadzone)
        {
            Focus = true;
        }
        else
        {
            Focus = false;
        }


        if (Input.GetButtonDown(interactKeyName))
        {
            PickUp?.Invoke();
        }

        //ToggleRagdoll for testing toggle for ragdolling
        if (Input.GetButtonDown(doRagdollKeyName))
        {
            ToggleRagdoll?.Invoke();
        }


        if (Input.GetButtonDown(doRagdollKeyName))
        {
            HoldRagdoll = true;
        }
        if (Input.GetButtonUp(doRagdollKeyName))
        {
            HoldRagdoll = false;
        }

        if (Input.GetButtonDown(LBKeyName))
        {
            ActivateLeftHand = true;
        }
        if (Input.GetButtonUp(LBKeyName))
        {
            ActivateLeftHand = false;
        }

        if (Input.GetButtonDown(RBKeyName))
        {
            ActivateRightHand = true;
        }
        if (Input.GetButtonUp(RBKeyName))
        {
            ActivateRightHand = false;
        }
    }
        private void RegisterStates()
        {
            mStateMachin = new StateMachin();

            mStateMachin.RegisterState(MousToken.Pickup, new MousState[] { MousState.Normal }, MousState.PickedUp, delegate { PickUp?.Invoke(); mTarget.SetTocken(BugToken.PickUp); });
            mStateMachin.RegisterState(MousToken.Drop, new MousState[] { MousState.PickedUp }, MousState.Normal, delegate { Drop?.Invoke(); mTarget.SetTocken(BugToken.Drop); });
            mStateMachin.RegisterState(MousToken.DeletBug, new MousState[] { MousState.PickedUp }, MousState.Normal, delegate { mTarget = null; });
            mStateMachin.RegisterState(MousToken.EnterInfo, new MousState[] { MousState.PickedUp }, MousState.OverInfo, null);
            mStateMachin.RegisterState(MousToken.ExitInfo, new MousState[] { MousState.OverInfo }, MousState.PickedUp, null);
            mStateMachin.RegisterState(MousToken.InfoClick, new MousState[] { MousState.OverInfo }, MousState.Scaning, delegate { OpenScan?.Invoke(); mTarget.SetTocken(BugToken.OpenScan); });
            mStateMachin.RegisterState(MousToken.InfoClick, new MousState[] { MousState.Scaning }, MousState.PickedUp, delegate { CloseScan?.Invoke(); mTarget.SetTocken(BugToken.CloseScan); });
        }