Steam lobby implemented

This commit is contained in:
Madhav Kapa
2023-06-01 08:03:48 -07:00
parent c7647c8097
commit 49efee80e2
95 changed files with 10258 additions and 6167 deletions

View File

@ -1,18 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Insertable : MonoBehaviour
{
// Start is called before the first frame update
void Start()
private void Start()
{
}
// Update is called once per frame
void Update()
private void Update()
{
}
}
}

View File

@ -1,20 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Interactable : MonoBehaviour
{
// Start is called before the first frame update
void Start()
private void Start()
{
}
// Update is called once per frame
void Update()
private void Update()
{
}
}
}

View File

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