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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user