mirror of
https://udrimavric.com/MAVRIC/Stratasys-450mc-VR.git
synced 2025-01-26 01:08:28 -05:00
36 lines
869 B
C#
36 lines
869 B
C#
using UnityEngine;
|
|
|
|
namespace UnityEngine.XR.Interaction.Toolkit.Samples
|
|
{
|
|
public class ToggleGameObject : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
GameObject m_ActivationGameObject;
|
|
|
|
public GameObject activationGameObject
|
|
{
|
|
get => m_ActivationGameObject;
|
|
set => m_ActivationGameObject = value;
|
|
}
|
|
|
|
[SerializeField]
|
|
bool m_CurrentlyActive = false;
|
|
|
|
public bool currentlyActive
|
|
{
|
|
get => m_CurrentlyActive;
|
|
set
|
|
{
|
|
m_CurrentlyActive = value;
|
|
activationGameObject.SetActive(m_CurrentlyActive);
|
|
}
|
|
}
|
|
|
|
public void ToggleActiveState()
|
|
{
|
|
m_CurrentlyActive = !m_CurrentlyActive;
|
|
activationGameObject.SetActive(m_CurrentlyActive);
|
|
}
|
|
}
|
|
}
|