コード例 #1
0
    void GetInput()
    {
        if (!UIManager.Instance.IsPlayable())
        {
            return;
        }

        if (Input.GetMouseButton(0))
        {
            CursorOnOff.ChangeCursorState(false);
            isRunning = true;
        }

        if (!isRunning)
        {
            return;
        }

        verticalAxisInput   = Input.GetAxis("Vertical");
        horizontalAxisInput = Input.GetAxis("Horizontal");
        mouseXInput         = Input.GetAxis("Mouse X");
        mouseYInput         = Input.GetAxis("Mouse Y");

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            CursorOnOff.ChangeCursorState(true);
            isRunning = false;
        }

        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            SpecialMove();
        }

        if (Input.GetKeyDown(KeyCode.Space) && hooked)
        {
            Jump();
            hooked           = false;
            rBody.useGravity = true;
        }
    }
コード例 #2
0
    void Start()
    {
        CursorOnOff.ChangeCursorState(false);
        if (!isLocalPlayer)
        {
            playerCam.enabled = false;
        }
        targetRotation = transform.rotation;
        if (GetComponent <Rigidbody> ())
        {
            rBody = GetComponent <Rigidbody> ();
        }
        else
        {
            Debug.LogError("This component requires a Rigidbody.");
        }

        verticalAxisInput = horizontalAxisInput = 0;
        isRunning         = true;

        this.transform.position = SpawnPointManager.Instance.SpawnPointLocation(1);
    }