Exemple #1
0
        IEnumerator ClearHighlight(BuildingHighlight highlight)
        {
            yield return(new WaitForSeconds(HighlightOnScreenTime));

            Debug.Log("ClearHighlighs: ");
            highlight.Discard();
        }
    void OnBuildingInformationReceived(BuildingHighlight highlight)
    {
        if (highlight.IsDiscarded())
        {
            Debug.Log(string.Format("No building information was received"));
            return;
        }

        var buildingInformation = highlight.GetBuildingInformation();

        var boxAnchor = Instantiate(boxPrefab) as GameObject;

        boxAnchor.GetComponent <GeographicTransform>().SetPosition(buildingInformation.BuildingDimensions.Centroid);

        var box = boxAnchor.transform.GetChild(0);

        box.localPosition = Vector3.up * (float)buildingInformation.BuildingDimensions.TopAltitude;
        Destroy(boxAnchor, 2.0f);

        Debug.Log(string.Format("Building information received: {0}", buildingInformation.ToJson()));

        highlight.Discard();
    }
    IEnumerator ClearHighlight(BuildingHighlight highlight)
    {
        yield return(new WaitForSeconds(4.0f));

        highlight.Discard();
    }