Пример #1
0
    // Use this for initialization

    IEnumerator Start()
    {
        locationProvider = GameObject.Find("LocationProviderFactoryObject").GetComponent <LocationProviderFactory>().TransformLocationProvider;
        abstractMap      = GameObject.Find("Map").GetComponent <AbstractMap>();
        ttsHandler       = GameObject.Find("TextToSpeechHandler").GetComponent <TextToSpeechHandler> ();
        bsHandler        = GameObject.Find("BingSearchHandler").GetComponent <BingSearchHandler> ();
        poiRegex         = new Regex(@"POI Panel");
        yield return(new WaitUntil(() => abstractMap.isReady == true));

        mapCenter = abstractMap.getCenterLongLat();
        //initialise infopanel dictionary
        infoPanelMap = new Dictionary <int, Transform>();
        for (int x = 0; x < infoPanel.transform.childCount; x++)
        {
            Transform thing = infoPanel.transform.GetChild(x);
            Debug.Log(thing.name);
            Debug.Log(poiRegex.Match(thing.name).Value);
            if (poiRegex.Match(thing.name).Length != 0)
            {
                Debug.Log("Adding Key: " + thing.name [thing.name.Length - 1]);
                infoPanelMap.Add(int.Parse((thing.name [thing.name.Length - 1]).ToString()), thing);
            }
        }
        Debug.Log("Dict Size: " + infoPanelMap.Keys.Count);
        foreach (int key in infoPanelMap.Keys)
        {
            Debug.Log("Key : " + key);
        }
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        buttonText = gameObject.GetComponentInChildren <Text>().text;

        buttonSelector    = GetComponentInParent <ButtonSelector>();
        playerlocation    = GameObject.Find("Player").GetComponent <PlayerLocation>();
        ttsHandler        = GameObject.Find("TextToSpeechHandler").GetComponent <TextToSpeechHandler>();
        uiManager         = GameObject.Find("UIManager").GetComponent <UIManager>();
        locator           = GameObject.Find("Player").GetComponent <BingMapsClassesLocator>();
        bingSearchHandler = GameObject.Find("BingSearchHandler").GetComponent <BingSearchHandler>();
    }