Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (target == null)
        {
            target = targetName == null ? null : map.countries[map.GetCountryIndex(targetName)];
            return;
        }

        if (target.data.eventQueue.Count <= 6)
        {
            int i = 0;
            for (; i < target.data.eventQueue.Count; i++)
            {
                sprites [i].sprite = archive.getSprite(target.data.eventQueue [target.data.eventQueue.Count - 1 - i]);
            }
            for (; i < 6; i++)
            {
                sprites [i].sprite = null;
            }
        }
        else
        {
            for (int i = 0; i < 6; i++)
            {
                sprites [i].sprite = archive.getSprite(target.data.eventQueue [target.data.eventQueue.Count - 1 - i]);
            }
            // ADD new ... icon
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        Vector3 screenPos = Camera.main.WorldToScreenPoint(map.renderViewport.transform.position);
        Vector3 mapPos;

        if (map.GetLocalHitFromScreenPos(screenPos, out mapPos))
        {
            int d = map.GetCountryIndex(mapPos);
            if (d != c)
            {
                c = d;
                if (c >= 0)
                {
                    Debug.Log("Country at center of viewport: " + map.countries [c].name);
                }
            }
        }
    }
Exemplo n.º 3
0
    public void loadEventData(SaveEventData ed)
    {
        map  = WorldMap2D.instance;
        anim = GetComponent <Animator> ();

        if (ed.eventName != eventName())
        {
            Debug.Log("Event Load Error");
        }

        deltaCultist     = ed.deltaCultist;
        deltaGdp         = ed.deltaGdp;
        deltaPopulation  = ed.deltaPopulation;
        deltaReligion    = ed.deltaReligion;
        deltaResource    = ed.deltaResource;
        deltaTechnology  = ed.deltaTechnology;
        deltaUnhappiness = ed.deltaUnhappiness;
        targetname       = ed.targetname;
        destroyTime      = ed.destroyTime;
        destroyCountdown = ed.destroyCountdown;

        target     = map.countries [map.GetCountryIndex(targetname)];
        loadStatus = true;
    }
Exemplo n.º 4
0
    void FlyToCountry(string countryName)
    {
        int countryIndex = map.GetCountryIndex(countryName);

        FlyToCountry(countryIndex);
    }