Пример #1
0
    public override void UpdateState()
    {
        if (isPressedRT)
        {
            if (TribotInput.GetButtonUp(TribotInput.InputButtons.RT, -1))
            {
                isPressedRT = false;
            }
        }
        if (isPressedLT)
        {
            if (TribotInput.GetButtonUp(TribotInput.InputButtons.LT, -1))
            {
                isPressedLT = false;
            }
        }

        if (PhotonNetwork.inRoom)
        {
            if (TribotInput.GetButton(TribotInput.InputButtons.RT, -1) && !isPressedRT)
            {
                isPressedRT = true;
                photonView.RPC("Iterate", PhotonTargets.MasterClient, IterateType.Next, ModelSkin.Model,
                               (int)PhotonNetwork.player.CustomProperties["Index"]);
            }
            if (TribotInput.GetButtonDown(TribotInput.InputButtons.RB, -1))
            {
                photonView.RPC("Iterate", PhotonTargets.MasterClient, IterateType.Next, ModelSkin.Skin,
                               (int)PhotonNetwork.player.CustomProperties["Index"]);
            }

            if (TribotInput.GetButton(TribotInput.InputButtons.LT, -1) && !isPressedLT)
            {
                isPressedLT = true;
                photonView.RPC("Iterate", PhotonTargets.MasterClient, IterateType.Previous, ModelSkin.Model,
                               (int)PhotonNetwork.player.CustomProperties["Index"]);
            }
            if (TribotInput.GetButtonDown(TribotInput.InputButtons.LB, -1))
            {
                photonView.RPC("Iterate", PhotonTargets.MasterClient, IterateType.Previous, ModelSkin.Skin,
                               (int)PhotonNetwork.player.CustomProperties["Index"]);
            }
        }
    }
Пример #2
0
    void Update()
    {
        int index;

        if (PhotonNetwork.offlineMode)
        {
            index = InputIndex;
        }
        else if ((int)PhotonNetwork.player.CustomProperties["Index"] == _info.Index)
        {
            index = -1;
        }
        else
        {
            return;
        }

        if (_player.CurrentAbility)
        {
            if (TribotInput.GetButtonUp(_player.CurrentAbility.MappedButton, index))
            {
                _abilityHandler.ReleaseAbility(_player.CurrentAbility);
            }
        }

        if (_state.CanInteract)
        {
            foreach (var ability in _player.Abilities)
            {
                if (TribotInput.GetButtonDown(ability.Key, index))
                {
                    _abilityHandler.CastAbility(ability.Value);
                }
            }
        }
    }