[HOWTO] How To: Show Cursor when Using Game Kit Controller (GKC)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Show Cursor when Using Game Kit Controller (GKC)

Post by Tony Li »

Game Kit Controller (GKC) hides and locks the mouse cursor except for its own menus. To tell GKC to show the cursor during conversations, add this script to the Dialogue Manager:

FreeCursorDuringConversation.cs

Code: Select all

using UnityEngine;
public class FreeCursorDuringConversations : MonoBehaviour
{
    private menuPause menuPause;

    public void OnConversationStart(Transform actor)
    {
        menuPause = FindObjectOfType<menuPause>();
        if (menuPause) menuPause.setMouseButtonPressPausedState(true);
        PixelCrushers.DialogueSystem.Tools.SetCursorActive(true);
    }

    public void OnConversationEnd(Transform actor)
    {
        if (menuPause) menuPause.setMouseButtonPressPausedState(false);
    }
}
Post Reply