Ejemplo n.º 1
0
    public AutoAttackModel StartChargeAttack(GameObject target, ChargeAttackInputHandler inputHandler)
    {
        ReplicationView view = target.GetComponent <ReplicationView>();

        StartChargeAttackRPC(view.viewId);
        _viewRPC.RPC("StartChargeAttackRPC", EB.RPCMode.Others, view.viewId);

        return(_combatController.GetCurrentAttack());
    }
Ejemplo n.º 2
0
    public void SetIsOwnershipTransferAllowed(bool allowed)
    {
        _isOwnershipTransferAllowed = allowed;

        if (GetNetworkOwnershipComponentViewRPC() != null)
        {
            _networkOwnershipComponentViewRPC.RPC("SetIsOwnershipTransferAllowedRPC", EB.RPCMode.Others, _isOwnershipTransferAllowed);
        }

        if (!LevelOwnerComponent.IsLevelOwner(PlayerManager.LocalPlayerController().ReplicationPlayer))
        {
            EB.Debug.LogWarning("NetworkOwnershipComponent: SetIsOwnershipTransferAllowed called on a machine other than the level owner has potential for bugs");
        }
    }
Ejemplo n.º 3
0
    public void Interact(GameObject player)
    {
        if (Time.time - _lastInteractTimestamp < 0.5f)
        {
            return;
        }

        _lastInteractTimestamp = Time.time;
        InteractFromRPC(player);
        if (!LocalOnly && _viewRPC != null)
        {
            ReplicationView playerView = player.GetComponent <ReplicationView>();
            _viewRPC.RPC("InteractRPC", EB.RPCMode.Others, playerView.viewId);
        }
    }
Ejemplo n.º 4
0
    public void SetAttackTarget(GameObject target, bool shouldIssueCommand = true)
    {
        if (/*(GameStateManager.Instance.State != eGameState.Overworld) &&*/ !NetworkOwnershipComponent.IsGameObjectLocallyOwned(gameObject, _network))
        {
            return;
        }

        if (target != null)
        {
            SetMovementTargetNoRPC(Vector3.zero, true);
            SetAttackTargetFromRPC(target, shouldIssueCommand);
        }
        else
        {
            ClearAttackTargetRPC();

            if (_viewRPC != null)
            {
                _viewRPC.RPC("ClearAttackTargetRPC", EB.RPCMode.Others);
            }
        }
    }