gun elements added and uvs updated to better space out texture.

This commit is contained in:
2023-04-03 11:02:11 -04:00
parent a5eebfa7cf
commit 174e912d1f
68 changed files with 13545 additions and 4295 deletions

View File

@ -0,0 +1,58 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ItemSelector : MonoBehaviour
{
[SerializeField]
private Camera cam;
private InteractableItem selected;
[SerializeField]
private bool debug = false;
[SerializeField]
private LayerMask mask;
public static ItemSelector instance;
[SerializeField]
private float range = 1;
public InteractableItem Selected { get { return selected; } }
// Start is called before the first frame update
void Start()
{
instance = this;
}
void FixedUpdate()
{
Ray ray = cam.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit,range,layerMask:mask))
{
if(selected!= null||hit.transform.gameObject==null)
{
selected.Disable();
}
selected = hit.transform.gameObject.GetComponent<InteractableItem>();
selected.Enable();
print(selected);
}
else
{
if (selected != null)
{
selected.Disable();
}
}
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9eb8c70704eba0741a0b281bc6ff3d8c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: