Initial commit

This commit is contained in:
2026-03-17 13:40:09 +02:00
commit 91fb7fdad5
1055 changed files with 388166 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
using UnityEngine;
using System.Collections;
public class GunAim:MonoBehaviour
{
public int borderLeft;
public int borderRight;
public int borderTop;
public int borderBottom;
private Camera parentCamera;
private bool isOutOfBounds;
void Start ()
{
parentCamera = GetComponentInParent<Camera>();
}
void Update()
{
float mouseX = Input.mousePosition.x;
float mouseY = Input.mousePosition.y;
if (mouseX <= borderLeft || mouseX >= Screen.width - borderRight || mouseY <= borderBottom || mouseY >= Screen.height - borderTop)
{
isOutOfBounds = true;
}
else
{
isOutOfBounds = false;
}
if (!isOutOfBounds)
{
transform.LookAt(parentCamera.ScreenToWorldPoint (new Vector3(mouseX, mouseY, 5.0f)));
}
}
public bool GetIsOutOfBounds()
{
return isOutOfBounds;
}
}