Ejemplo n.º 1
0
    void CmdAttemptGrab()
    {
        // TODO: Check and grab
        Transform grabTransform = _grabArea.GetClosestGrabable();

        if (grabTransform == null)
        {
            return;
        }

        IGrabable grab = grabTransform.GetComponent <IGrabable>();

        if (grab == null)
        {
            return;
        }

        _grabbedObject = grab;
        _grabbedObject.OnGrab(this);

        RpcGrabLocalObject(grab.GetNetId());
    }