/// <summary> /// This function is called when the IlcCore Server request informations for an InfoPoint. /// Step 2 /// To get Informations into your apps you need insert the appropiate BusinessObject into the dataInterface /// </summary> /// <param name="context"></param> /// <param name="infoPoint"></param> /// <param name="dataInterface"></param> public void CollectInformations(InformationProcess context, InfoPoint infoPoint, IInformationDataInterface dataInterface) { var company = infoPoint.Value as Company; if (company == null) return; dataInterface.Insert(company); dataInterface.Flush(); if (dataInterface.MustCollect<ContactPerson>()) { var contactsLoader = new ContactsLoader(); var contacts = contactsLoader.LoadContactsByCompany(company); dataInterface.Insert(contacts); dataInterface.Flush(); } // Step 3 // we Add the ProductsLoader and the Ilc.BusinessObjects.AdventureWorks Library // to showcase the Detail-Loading procedure // Details-Loading is deferred by creating and setting an DetailsLink for the InformationObject if (dataInterface.MustCollect<BikeProduct>()) { var productsLoader = new ProductsLoader(); var products = productsLoader.LoadProductByCompany(company); foreach (var product in products) { var detailsLink = new List<DetailsLink>(); detailsLink.Add(dataInterface.CreateDetailsLink(Constants.ProductPhotoDetailslink, product.Id)); dataInterface.Insert(product, null, detailsLink); } dataInterface.Flush(); } }
private void ShowInfoPoint(GameObject infoPoint, bool forward) { InfoBox.SetActive(true); Text info = InfoBox.GetComponentInChildren <Text>(); //new Vector2 lastPos = new Vector2(-displayedObject.transform.forward.x, -displayedObject.transform.forward.z); if (lastTickedInfP) { lastPos = new Vector2(lastTickedInfP.transform.localPosition.x, lastTickedInfP.transform.localPosition.z); } lastPos.Normalize(); Vector2 newPos = new Vector2(infoPoint.transform.localPosition.x, infoPoint.transform.localPosition.z); newPos.Normalize(); float rotAngle = Vector2.Angle(lastPos, newPos); if ((forward && rotAngle < 0) || (!forward && rotAngle > 0)) { rotAngle *= -1; } targetRotation = Quaternion.AngleAxis(rotAngle, new Vector3(0, 1, 0)) * displayedObject.transform.rotation; rotateToTarget = true; if (lastTickedInfP) { lastTickedInfP.ChangeMat(false); } lastTickedInfP = infoPoint.GetComponent <InfoPoint>(); info.text = lastTickedInfP.InfoText; lastTickedInfP.ChangeMat(true); }
public void CreatePoint(JSONObject sphericalNode, JSONObject hierarchyNode) { InfoPoint sphericalInfoPoint = InfoPoint.CreateFromJSON(sphericalNode.Print()); InfoPoint hierarchyInfoPoint = InfoPoint.CreateFromJSON(hierarchyNode.Print()); GameObject pointObject = Instantiate(pointToInstantiate, sphericalInfoPoint.position, Quaternion.identity); Points.Add(pointObject); pointObject.transform.parent = infoGraph.transform; pointObject.GetComponent <Point>().Id = sphericalInfoPoint.id; pointObject.GetComponent <Point>().Label = sphericalInfoPoint.label; pointObject.GetComponent <Point>().Type = sphericalInfoPoint.type; pointObject.GetComponent <Point>().SphericalPosition = sphericalInfoPoint.position; pointObject.GetComponent <Point>().HierarchyPosition = hierarchyInfoPoint.position; sphericalPointPositions[sphericalInfoPoint.id] = sphericalNode["position"]; hierarchyPointPositions[hierarchyInfoPoint.id] = hierarchyNode["position"]; }
public void CreatePoint(JSONObject sphericalNode, JSONObject hierarchyNode) { InfoPoint sphericalInfoPoint = InfoPoint.CreateFromJSON(sphericalNode.Print()); InfoPoint hierarchyInfoPoint = InfoPoint.CreateFromJSON(hierarchyNode.Print()); GameObject pointObject = Instantiate(pointToInstantiate, sphericalInfoPoint.position, Quaternion.identity); Points.Add(pointObject); pointObject.transform.parent = infoGraph.transform; pointObject.transform.localRotation = Quaternion.Euler(new Vector3(90, 0, 0)); pointObject.transform.GetChild(1).gameObject.transform.GetChild(0).gameObject.GetComponent <Text>().text = sphericalInfoPoint.label; // Add label to poitn text pointObject.GetComponent <Point>().Id = sphericalInfoPoint.id; pointObject.GetComponent <Point>().Label = sphericalInfoPoint.label; pointObject.GetComponent <Point>().Type = sphericalInfoPoint.type; pointObject.GetComponent <Point>().SphericalPosition = sphericalInfoPoint.position; pointObject.GetComponent <Point>().HierarchyPosition = hierarchyInfoPoint.position; sphericalPointPositions[sphericalInfoPoint.id] = sphericalNode["position"]; hierarchyPointPositions[hierarchyInfoPoint.id] = hierarchyNode["position"]; }
public void CreateInfoPoints(List <Info> infos, Transform anchors) { for (int i = 0; i < infos.Count; i++) { InfoPoint infoPoint = Instantiate(infoPointPrefab).GetComponent <InfoPoint>(); infoPoint.transform.SetParent(anchors.GetChild(i), false); string imagePath = "Avatars/" + infos[i].image; imagePath = imagePath.Replace("Layer", ""); infoPoint.SetContent(infos[i]); infoPoint.SetImagePath(imagePath); infoPoint.SetDelay(i * FADE_IN_DELAY); infoPoint.gameObject.SetActive(true); infoPoint.onClick.AddListener(() => OnInfoPointClick(infoPoint)); } }
public void ClearInfoPoints(Transform anchors) { foreach (Transform anchor in anchors) { if (anchor.childCount > 0) { InfoPoint infoPoint = anchor.GetComponentInChildren <InfoPoint>(); if (infoPoint != null) { infoPoint.Hide(); } Transform extraImages = anchor.Find("ExtraImages"); if (extraImages != null) { HideExtraImages(extraImages); } } } }
private void OnInfoPointClick(InfoPoint infoPoint) { clickSound.Play(); if (selectedInfoPoint != null) { selectedInfoPoint.HideInfoTag(); selectedInfoPoint.interactable = true; Transform extraImages = this.selectedInfoPoint.transform.parent.Find("ExtraImages"); if (extraImages) { HideExtraImages(extraImages); } } infoPoint.interactable = false; this.selectedInfoPoint = infoPoint; ShowInfoTag(); ShowExtraImages(); }
/// <summary> /// This function is called when the IlcCore Server request informations for an InfoPoint. /// Step 2 /// To get Informations into your apps you need insert the appropiate BusinessObject into the dataInterface /// </summary> /// <param name="context"></param> /// <param name="infoPoint"></param> /// <param name="dataInterface"></param> public void CollectInformations(InformationProcess context, InfoPoint infoPoint, IInformationDataInterface dataInterface) { var company = infoPoint.Value as Company; if (company == null) { return; } dataInterface.Insert(company); dataInterface.Flush(); if (dataInterface.MustCollect <ContactPerson>()) { var contactsLoader = new ContactsLoader(); var contacts = contactsLoader.LoadContactsByCompany(company); dataInterface.Insert(contacts); dataInterface.Flush(); } // Step 3 // we Add the ProductsLoader and the Ilc.BusinessObjects.AdventureWorks Library // to showcase the Detail-Loading procedure // Details-Loading is deferred by creating and setting an DetailsLink for the InformationObject if (dataInterface.MustCollect <BikeProduct>()) { var productsLoader = new ProductsLoader(); var products = productsLoader.LoadProductByCompany(company); foreach (var product in products) { var detailsLink = new List <DetailsLink>(); detailsLink.Add(dataInterface.CreateDetailsLink(Constants.ProductPhotoDetailslink, product.Id)); dataInterface.Insert(product, null, detailsLink); } dataInterface.Flush(); } }
public void CollectInformations(InformationProcess context, InfoPoint infoPoint, IInformationDataInterface dataInterface) { }