示例#1
0
    public void Reload(int mapId)
    {
        if (mapId == 1237)
        {
            mapId = 1099;
        }

        mMapId = mapId;
        Debug.Log("Map Loaded: " + mapId);

        isInWvwMap = mValidMapIds.Contains(mapId);

        if (isInWvwMap)
        {
            if (mainLoop == null)
            {
                mainLoop = StartCoroutine(MainLoop());
            }
        }
        else
        {
            Debug.Log("Clearing any wvw data...");
            ArrayExpander.Expand(transform, 0);
        }
    }
示例#2
0
    public void Reload(int mapId)
    {
        mPointList.Clear();
        mMapId = mapId;

#if UNITY_EDITOR
        LoadFile("SAB_Dig_Locations.xml");
#else
        string[] files = Environment.GetCommandLineArgs();
        for (int ii = 1; ii < files.Length; ++ii)
        {
            if (File.Exists(files[ii]))
            {
                LoadFile(files[ii]);
            }
        }
#endif

        ArrayExpander.Expand(transform, mPointList.Count);

        for (int ii = 0; ii < mPointList.Count; ++ii)
        {
            Transform t = transform.GetChild(ii);
            t.position = mPointList[ii];
            t.gameObject.SetActive(true);
        }

        Debug.Log("Loading " + mPointList.Count + " taco POIs.");
    }
示例#3
0
 void Start()
 {
     ArrayExpander.Expand(transform, 0);
 }
示例#4
0
    private void RefreshMap(Gw2MatchMap mapItem)
    {
        int index = 0;

        SetAppIconColor();

        float[][] cr = mMapTable[mapItem.id].continent_rect;

        var rect = new Rect(cr[0][0], cr[0][1], cr[1][0] - cr[0][0], cr[1][1] - cr[0][1]);

        foreach (var objective in mapItem.objectives)
        {
            var objectiveItem = mObjectiveMap[objective.id];

            if (objectiveItem == null || objectiveItem.coord == null || objectiveItem.coord.Length < 3)
            {
                //Debug.Log("Couldn't find objective lookup for id: " + objective.id);
                continue;
            }

            index++;
        }

        ArrayExpander.Expand(transform, index);
        index = 0;

        foreach (var objective in mapItem.objectives)
        {
            var objectiveItem = mObjectiveMap[objective.id];

            if (objectiveItem == null || objectiveItem.coord == null || objectiveItem.coord.Length < 3)
            {
                //Debug.Log("Couldn't find objective lookup for id: " + objective.id);
                continue;
            }

            var wvwItem = transform.GetChild(index).GetComponent <WvWItem>();

            float[] eventcoord = objectiveItem.coord;

            float x = (eventcoord[0] - rect.center.x) * worldScale;
            float z = (rect.center.y - eventcoord[1]) * worldScale;

            float y = eventcoord[2] * heightScale + heightOffset;

            //Debug.Log(objectiveItem.name + "  " + x + "   " + z);

            wvwItem.transform.position = new Vector3(x, y, z);
            wvwItem.image.sprite       = GetSprite(objectiveItem.type);

            wvwItem.image.color     = fullyLoaded ? objective.GetColor() : Color.white;
            wvwItem.title.text      = objectiveItem.name;
            wvwItem.title.color     = wvwItem.image.color;
            wvwItem.gameObject.name = objectiveItem.name;
            wvwItem.gameObject.SetActive(true);

            string ri = fullyLoaded ? GetRI(objective.last_flipped) : null;
            wvwItem.riLabel.gameObject.SetActive(ri != null);
            if (ri != null)
            {
                wvwItem.riLabel.text = ri;
            }

            index++;
        }
    }
示例#5
0
 void Awake()
 {
     ArrayExpander.Expand(transform, 0);
 }