void CreateComponent(InformationObject informationObject, PatternDetector patternDetector) { GameObject ARObjects = new GameObject(); ARObjects.name = "ARObjects"; ARObjects.SetActive(false); GameObject OBJMarkerSettings = new GameObject(); OBJMarkerSettings.name = "MarkerSettings"; MarkerDesign markerDesign = new MarkerDesign(); markerDesign.id = informationObject.IdMarker; MarkerSettings markerSettings = OBJMarkerSettings.AddComponent <MarkerSettings>(); markerSettings.PatternDetector = patternDetector; markerSettings.markerDesign = markerDesign; markerSettings.ARGameObject = ARObjects; GameObject objectAR = ImportResources.GetGameObject(informationObject.Name); GameObject objectCreated = Instantiate(objectAR); objectCreated.AddComponent <RectTransform>(); objectCreated.transform.position = Vector3.zero; objectCreated.transform.rotation = Quaternion.identity; objectCreated.layer = 8; objectCreated.transform.SetParent(ARObjects.transform); ARObjects.transform.SetParent(OBJMarkerSettings.transform); OBJMarkerSettings.transform.SetParent(markerList.transform); }
private GameObject SelectObject(string nameObject) { return(ImportResources.GetGameObject(nameObject)); }