28 lines
680 B
C#
28 lines
680 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class StartUI : MonoBehaviour
|
|
{
|
|
public GameObject startUI;
|
|
GameObject player;
|
|
|
|
void Start()
|
|
{
|
|
player = GameObject.Find("PlayerCapsule");
|
|
player.GetComponent<CharacterControl>().active=false;
|
|
Time.timeScale = 0f;
|
|
Cursor.visible = true;
|
|
Cursor.lockState = CursorLockMode.Confined;
|
|
}
|
|
|
|
public void onStartGame()
|
|
{
|
|
player.GetComponent<CharacterControl>().active=true;
|
|
|
|
Time.timeScale = 1f;
|
|
Cursor.visible = false;
|
|
Cursor.lockState = CursorLockMode.Locked;
|
|
startUI.SetActive(false);
|
|
}
|
|
}
|