26 lines
381 B
C#
26 lines
381 B
C#
using UnityEngine;
|
|
|
|
public class DestroyInVR : MonoBehaviour
|
|
{
|
|
public static int howMany;
|
|
|
|
public float minScale = 1.6f;
|
|
|
|
public bool destroy;
|
|
|
|
private void Start()
|
|
{
|
|
if (VRManager.IsVROn() && base.transform.localScale.x < minScale)
|
|
{
|
|
if (destroy)
|
|
{
|
|
Object.DestroyImmediate(base.gameObject);
|
|
}
|
|
else
|
|
{
|
|
base.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|