Merge branch 'main' of https://gitea.deprived.dev/Sveskejuice/3DTD
This commit is contained in:
commit
8b015c4d33
|
@ -25,20 +25,22 @@ public class CameraSlotClickDetect : MonoBehaviour
|
||||||
Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition);
|
Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition);
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
|
|
||||||
if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
|
|
||||||
{
|
|
||||||
var slotInfo = hit.collider.gameObject.GetComponentInParent<SlotManager>();
|
|
||||||
slotInfo.OnClick();
|
|
||||||
GameManager.Instance.SelectedTower = null;
|
|
||||||
}
|
|
||||||
RaycastHit selectHit;
|
RaycastHit selectHit;
|
||||||
if (Physics.Raycast(ray, out selectHit, Mathf.Infinity, selectLayer) && !GameManager.Instance.IsBuildMode)
|
if (Physics.Raycast(ray, out selectHit, Mathf.Infinity, selectLayer) && !GameManager.Instance.IsBuildMode)
|
||||||
{
|
{
|
||||||
var tower = selectHit.collider.gameObject.GetComponentInChildren<Tower>();
|
var tower = selectHit.collider.gameObject.GetComponentInChildren<Tower>();
|
||||||
if (tower != null)
|
if (tower != null)
|
||||||
|
{
|
||||||
GameManager.Instance.SelectedTower = tower;
|
GameManager.Instance.SelectedTower = tower;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
|
||||||
|
{
|
||||||
|
var slotInfo = hit.collider.gameObject.GetComponentInParent<SlotManager>();
|
||||||
|
slotInfo.OnClick();
|
||||||
|
GameManager.Instance.SelectedTower = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ShootHoverRay()
|
void ShootHoverRay()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue