Assemblies Made and Refactored Code Folders

Created assemblies for the new design code. Relocated legacy scripts into a legacy folder and made a "new_design" folder for new design.
This commit is contained in:
MarcoHampel
2023-09-11 19:39:27 -04:00
parent 84b455b473
commit f8590432ba
209 changed files with 729 additions and 0 deletions

View File

@ -0,0 +1,15 @@
using UnityEngine;
namespace Item {
public class Insertable : MonoBehaviour
{
// Start is called before the first frame update
private void Start()
{
}
// Update is called once per frame
private void Update()
{
}
}
}

View File

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

View File

@ -0,0 +1,18 @@
using UnityEngine;
namespace Item
{
public class Interactable : MonoBehaviour
{
// Start is called before the first frame update
private void Start()
{
}
// Update is called once per frame
private void Update()
{
}
}
}

View File

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

View File

@ -0,0 +1,46 @@
using UnityEngine;
namespace Item
{
public class ItemSelector : MonoBehaviour
{
public static ItemSelector instance;
[SerializeField] private Camera cam;
[SerializeField] private LayerMask mask;
[SerializeField] private float range = 1;
public InteractableItem Selected { get; private set; }
// Start is called before the first frame update
private void Start()
{
instance = this;
}
// Update is called once per frame
private void Update()
{
}
private void FixedUpdate()
{
var ray = cam.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, range, 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();
}
}
}
}

View File

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