HKI Core
CursorEnAndDisabler.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 
4 namespace HKI.Core.Misc
5 {
9  public class CursorEnAndDisabler : MonoBehaviour
10  {
11  // Public variables
12  [SerializeField] bool DisableCursorOnStart = true;
13 
14  // Start function
15  void Start()
16  {
17  Cursor.visible = !DisableCursorOnStart;
18  }
19 
20  // OnDestroy function
21  void OnDestroy()
22  {
23  Cursor.visible = !Cursor.visible;
24  }
25  }
26 }
This MonoBehaviour disables and endables or the other way around the cursor on start and on destroy...