Initial commit of ongoing work

This commit is contained in:
Alex Stewart
2024-10-28 19:48:45 -07:00
parent 63aed8ab7c
commit 8a3b2a0206
40 changed files with 3448 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VisionCone : MonoBehaviour
{
[SerializeField] float size = 100.5f;
[SerializeField] bool renderMesh = false;
private Vector3 contact;
// Start is called before the first frame update
void Start()
{
setConditions();
this.transform.position = GetComponentInParent<Transform>().position;
}
// Update is called once per frame
void Update()
{
}
void setConditions()
{
transform.localScale = new Vector3(size, size, size);
GetComponent<Renderer>().enabled = renderMesh;
}
void OnTriggerEnter(Collider collider)
{
Debug.Log("Here");
contact = collider.ClosestPoint(transform.position);
}
public Vector3 getCollision()
{
return contact;
}
}