/// <summary> /// Start is called before the first frame update. /// </summary> void Start() { converter = GetComponent <SpatialMeshConversionHandler>(); observer = GetComponent <SpatialObserverHandler>(); calculator = gameObject.GetComponent <RoomVolumeCalculationHandler>(); // Register for the create surface planes complete event converter.CreateSurfacePlanesCompletedEvent += CreateSurfacePlanesCompletedEventHandler; }
/// <summary> /// Start is called before the first frame update. /// </summary> void Start() { GameObject spatialProcessing = GameObject.Find("SpatialProcessing"); observer = spatialProcessing.GetComponent <SpatialObserverHandler>(); converter = spatialProcessing.GetComponent <SpatialMeshConversionHandler>(); Debug.Log(Time.realtimeSinceStartup); PlaceLight(); StartCoroutine(CreateSphereRayCastToMesh()); }
/// <summary> /// Initializes the lighting unit game object. /// </summary> /// <param name="b"></param> public void Init(LightingUnit b, int index) { bulb = b; this.index = index; GameObject spatialProcessing = GameObject.Find("SpatialProcessing_and_RoomVolumeCalculation"); converter = spatialProcessing.GetComponent <SpatialMeshConversionHandler>(); observer = spatialProcessing.GetComponent <SpatialObserverHandler>(); }
/// <summary> /// Finds the surface planes in the scene and set them active. /// Helps to find locations where the power outlets can be attached. /// </summary> private void SetPlaneCollectionActive() { GameObject spatialProcessing = GameObject.Find("SpatialProcessing"); if (spatialProcessing == null) { spatialProcessing = GameObject.Find("SpatialProcessing_and_RoomVolumeCalculation"); } observer = spatialProcessing.GetComponent <SpatialObserverHandler>(); converter = spatialProcessing.GetComponent <SpatialMeshConversionHandler>(); planeCollection = converter.SurfacePlanesParent; planeCollection.SetActive(true); }