Page 1 of 1

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

Posted: Thu Jun 16, 2022 9:38 am
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);
    }
}