Looking-Glass/Assets/playerstuff/SwapLeftHandToGlass.cs

28 lines
700 B
C#
Raw Normal View History

2024-02-02 12:54:47 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SwapLeftHandToGlass : MonoBehaviour
{
public GameObject raycaster;
public GameObject controller1;
public GameObject controller2;
bool glassenabled = false;
// Start is called before the first frame update
public void Swap()
{
if(!glassenabled){
raycaster.SetActive(false);
controller1.SetActive(false);
controller2.SetActive(true);
}
else{
raycaster.SetActive(true);
controller1.SetActive(true);
controller2.SetActive(false);
}
glassenabled = !glassenabled;
}
}