EnableWhenReady.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class EnableWhenReady : MonoBehaviour {
  5. // Use this for initialization
  6. void Start () {
  7. if (ZEDManager.GetInstance (sl.ZED_CAMERA_ID.CAMERA_ID_01) != null)
  8. ZEDManager.GetInstance (sl.ZED_CAMERA_ID.CAMERA_ID_01).OnZEDReady += zedIsReady;
  9. if (ZEDManager.GetInstance (sl.ZED_CAMERA_ID.CAMERA_ID_02) != null)
  10. ZEDManager.GetInstance (sl.ZED_CAMERA_ID.CAMERA_ID_02).OnZEDReady += zedIsReady;
  11. if (ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_03) != null)
  12. ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_03).OnZEDReady += zedIsReady;
  13. if (ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_04) != null)
  14. ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_04).OnZEDReady += zedIsReady;
  15. }
  16. // Update is called once per frame
  17. void zedIsReady () {
  18. foreach (var tr in gameObject.GetComponentsInChildren<Transform>(true))
  19. tr.gameObject.SetActive (true);
  20. }
  21. }