コード例 #1
0
        /// <summary>
        /// Author: Denis
        /// Processes the Y(XB)/Triangle(PS4) button press and executes the jump
        /// </summary>
        /// <param name="Ctx"></param>
        private void RegisterPullDash(InputAction.CallbackContext Ctx)
        {
            //get a reference to the other player if null
            if (OtherPlayerPullDashScript == null)
            {
                GameObject[] _Players = GameObject.FindGameObjectsWithTag("Player");
                for (int i = 0; i < _Players.Length; i++)
                {
                    if (_Players[i].Equals(gameObject) == false)
                    {
                        OtherPlayer = _Players[i];
                        OtherPlayerPullDashScript = _Players[i].GetComponent <PullDash>();
                        OtherPlayerTarget         = OtherPlayerPullDashScript.OwnPullDashTarget;
                    }
                }
            }

            //the pull dash activation can only be validated if within distance
            Vector3 V = (OtherPlayer.transform.position - transform.position);

            if (ChargingPullDash == false && IsPullDashing == false && OtherPlayerPullDashScript != null &&
                V.magnitude <= MaxTriggerDistance && BlockInput == false && PlayerKnockback.IsKnockback == false)
            {
                ChargingPullDash = true;
                PullDashCharged  = false;
                StartCoroutine(PullDashCharge());

                PhotonView.Get(PlayerVFX).RPC("UpdateBeamBegin", RpcTarget.All, true);
            }
        }
コード例 #2
0
 /// <summary>
 /// Author: Denis
 /// Caching components
 /// </summary>
 private void Start()
 {
     PlayerPullDash    = gameObject.GetComponent <PullDash>();
     PlayerGroundPound = gameObject.GetComponent <GroundPound>();
     PlayerKnockback   = gameObject.GetComponent <Knockback>();
     PlayerMultiplayer = gameObject.GetComponent <MultiplayerActivator>();
 }
コード例 #3
0
ファイル: Dash.cs プロジェクト: UGL-McGill-2021/lionheart
 /// <summary>
 /// Author: Denis
 /// Caching components
 /// </summary>
 private void Start()
 {
     PlayerPullDash    = gameObject.GetComponent <PullDash>();
     PlayerJump        = gameObject.GetComponent <Jump>();
     PlayerCombat      = gameObject.GetComponent <PlayerCombatManager>();
     PlayerKnockback   = gameObject.GetComponent <Knockback>();
     PlayerMultiplayer = gameObject.GetComponent <MultiplayerActivator>();
 }