Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class My_GUI : MonoBehaviour
- {
- // Start is called before the first frame update
- private Camera _camera;
- void Start()
- {
- _camera = GetComponent<Camera>();
- Cursor.lockState = CursorLockMode.Locked;
- Cursor.visible = false;
- }
- // Update is called once per frame
- void OnGUI()
- {
- int size = 40;
- float posX = _camera.pixelWidth / 2 - size / 4;
- float posY = _camera.pixelHeight / 2 - size / 4;
- GUI.Label(new Rect(posX, posY, size, size), "*");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement