예제 #1
0
    void OnGUI()
    {
        Vector3 point        = new Vector3();
        Event   currentEvent = Event.current;
        Vector2 mousePos     = new Vector2();

        // Get the mouse position from Event.
        // Note that the y position from Event is inverted.
        mousePos.x = currentEvent.mousePosition.x;
        mousePos.y = cam.pixelHeight - currentEvent.mousePosition.y;

        point = cam.ScreenToWorldPoint(new Vector3(mousePos.x, mousePos.y, cam.nearClipPlane));

        // TODO TIMEOUT BETWEEN ABILITY USES
        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            controller.LaunchProjectile(point, hand[cardSelected]);
        }
    }