Added temporary LED's and Required Dependencies for easier building

I also added carding in button and toggling third person camera
This commit is contained in:
ItsCharaHere
2022-05-22 22:00:35 -07:00
parent 2268f72982
commit 8820fad498
13 changed files with 6713 additions and 1052 deletions
+33 -7
View File
@@ -11,15 +11,44 @@ public class ControlPanel : MonoBehaviour
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
public VirtualKeyCode key;
public VirtualKeyCode key2;
private int _insideColliderCount = 0;
public bool isToggle;
public bool isOn;
private Renderer cr;
public GameObject camera;
// Start is called before the first frame update
void Start()
{
cr = GetComponent<Renderer>();
}
private void OnTriggerEnter(Collider other)
{
_insideColliderCount += 1;
keybd_event(System.Convert.ToByte(key), (byte)MapVirtualKey((uint)key, 0), 0, UIntPtr.Zero);
if (isToggle == true)
{
if(isOn == false)
{
isOn = true;
cr.material.color = new Color(0f, 1f, 0f, 1f);
_insideColliderCount += 1;
keybd_event(System.Convert.ToByte(key), (byte)MapVirtualKey((uint)key, 0), 0, UIntPtr.Zero);
} else if (isOn == true)
{
isOn = false;
cr.material.color = new Color(1f, 0f, 0f, 1f);
_insideColliderCount += 1;
keybd_event(System.Convert.ToByte(key2), (byte)MapVirtualKey((uint)key2, 0), 0, UIntPtr.Zero);
}
} else if (isToggle == false)
{
_insideColliderCount += 1;
keybd_event(System.Convert.ToByte(key), (byte)MapVirtualKey((uint)key, 0), 0, UIntPtr.Zero);
}
}
private void OnTriggerExit(Collider other)
@@ -30,10 +59,7 @@ public class ControlPanel : MonoBehaviour
keybd_event(System.Convert.ToByte(key), (byte)MapVirtualKey((uint)key, 0), 2, UIntPtr.Zero);
}
void Start()
{
}
// Update is called once per frame
void Update()