Got rid of Fake Cursor
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class FakeCursor : MonoBehaviour
|
||||
{
|
||||
public RectTransform RectBounds;
|
||||
public Camera AttachedCamera;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//Cursor.visible = false;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
Vector2 size = new(Screen.width, Screen.height);
|
||||
Vector2 hSize = new Vector2(AttachedCamera.pixelRect.width, AttachedCamera.pixelRect.height) / 2f;
|
||||
Debug.Log(hSize);
|
||||
|
||||
Vector2 positionRelativeToMiddle = (size - hSize) + (Vector2)Input.mousePosition;
|
||||
transform.position = AttachedCamera.ScreenToWorldPoint(new Vector3(positionRelativeToMiddle.x, positionRelativeToMiddle.y, 5f));
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Cursor.visible = true;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 353f192b40556e34dada2d432a9ffa85
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user