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:
15
Assets/Scripts/Legacy/Interactable/Insertable.cs
Normal file
15
Assets/Scripts/Legacy/Interactable/Insertable.cs
Normal 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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Legacy/Interactable/Insertable.cs.meta
Normal file
11
Assets/Scripts/Legacy/Interactable/Insertable.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7406a2a2283cc074dba144678253dfee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
18
Assets/Scripts/Legacy/Interactable/Interactable.cs
Normal file
18
Assets/Scripts/Legacy/Interactable/Interactable.cs
Normal 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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Legacy/Interactable/Interactable.cs.meta
Normal file
11
Assets/Scripts/Legacy/Interactable/Interactable.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b461df434f407d4e9a24104595ac3c3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
46
Assets/Scripts/Legacy/Interactable/ItemSelector.cs
Normal file
46
Assets/Scripts/Legacy/Interactable/ItemSelector.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Legacy/Interactable/ItemSelector.cs.meta
Normal file
11
Assets/Scripts/Legacy/Interactable/ItemSelector.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9eb8c70704eba0741a0b281bc6ff3d8c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user