Пример #1
0
    void Start()
    {
        map = WorldMap2D.instance;


        time = GetComponent <Text>();
    }
Пример #2
0
    void Start()
    {
        Screen.SetResolution(1920, 1080, true);
        currentEvent = -1;
        map          = WorldMap2D.instance;
        data         = GlobalTW.instance;
        //data.Init();
        map.CenterMap(); // Center map on the screen

        FactionCount();
        MapChoice(-1);
        EventList.Enqueue(1);
        if (data.countries.player == 0)
        {
            EventList.Enqueue(32);
            EventList.Enqueue(33);
        }
        else if (data.countries.player == 1)
        {
            EventList.Enqueue(34);
            EventList.Enqueue(35);
        }
        nextEvent(false);

        flag.sprite = eventImages[data.countries.player];
        //WriteNewCountryList();
        explain.enabled     = false;
        ExplainText.enabled = false;
        ending = 0;
    }
Пример #3
0
    void Start()
    {
        map = WorldMap2D.instance;

        earthStyleText      = GameObject.Find("EarthStyleText").GetComponent <Text> ();
        earthStyleText.text = "Change Map Style: " + map.earthStyle.ToString();
    }
Пример #4
0
    void Start()
    {
        map = WorldMap2D.instance;


        monthText = GameObject.Find("Month").GetComponent <Text>();

        yearText = GameObject.Find("Year").GetComponent <Text>();
    }
Пример #5
0
    private void Start()
    {
        map        = WorldMap2D.instance;
        holdScript = this.gameObject.GetComponent <HoldToDisplay> ();
        holdScript.setName(ModName);

        abilityBar          = GameObject.Find("AbilityBar");
        abilityBarTransfrom = abilityBar.GetComponent <RectTransform> ();
        prevPosition        = new Vector2(abilityBarTransfrom.anchoredPosition.x, abilityBarTransfrom.anchoredPosition.y);
    }
Пример #6
0
    void Start()
    {
        energy      = GameObject.Find("EnergyDisplay").GetComponent <Text>();
        energy.text = " ";

        image            = this.gameObject.GetComponent <Image>();
        image.type       = Image.Type.Filled;
        image.fillAmount = 0f;
        //duration = 0f;

        map = WorldMap2D.instance;
    }
Пример #7
0
    private bool firstTime = true;     //OnEnable is ran before start, so we have to leave initiate this first

    void Init()
    {
        //Peter

        /*
         * population_Positivebar = Population_PositiveBar.GetComponent<Image> ();
         * population_Positivebar.fillAmount=0;
         * population_Negativebar = Population_NegativeBar.GetComponent<Image> ();
         * population_Negativebar.fillAmount=0;
         * populationBackgroundNegative = PopulationBackgroundNegative.GetComponent<Image> ();
         * populationBackgroundNegative.fillAmount = 0;
         * populationBackgroundPositive = PopulationBackgroundPositive.GetComponent<Image> ();
         * populationBackgroundPositive.fillAmount = 0;
         */
        //
        map               = WorldMap2D.instance;
        nameDisplay       = NameDisplay.GetComponent <Text> ();
        additionalDisplay = AdditionalDisplay.GetComponent <Text> ();
        display1          = Display1.GetComponent <Text> ();
        display2          = Display2.GetComponent <Text> ();
        details           = new Dictionary <string, EventDetail>();
        details.Add("RiotGenre", new EventDetail("Riot / Rebellion", 0, -1, -1, -2, 0, -1, -1, -1, -1, -2, 2, 1, "None"));
        details.Add("WarGenre", new EventDetail("Skirmish / War / Full-Scale War", -1, -3, 2, -3, -1, -2, -1, 2, 1, -1, 1, 3, "Worldwide"));
        details.Add("FinancialGenre", new EventDetail("Inflation / Financial Crisis", 0, -1, 1, -3, 0, -2, 0, -1, 1, -2, -1, 2, "None/Worldwide"));

        details.Add("Plague", new EventDetail(-3, -3, -2, 2, -2, 3, "Neighbors"));
        details.Add("TerroristAttack", new EventDetail(0, -1, 0, -2, 0, 2, "None"));

        details.Add("Riot", new EventDetail(0, -1, 0, -1, -1, 2, "None"));
        details.Add("Rebellion", new EventDetail(-1, -2, -1, -1, -2, 1, "None"));
        details.Add("Skirmish", new EventDetail(-1, 2, -1, -1, 1, 1, "Worldwide"));
        details.Add("War", new EventDetail(-1, -3, -1, 1, 0, 2, "Worldwide"));
        details.Add("FullScaleWar", new EventDetail(-3, -3, -2, 2, -1, 3, "Worldwide"));
        details.Add("Inflation", new EventDetail(0, 1, 0, 0, 1, -1, "None"));
        details.Add("FinancialCrisis", new EventDetail(-1, -3, -2, -1, -2, 2, "Worldwide"));


        details.Add("Tornado", new EventDetail("D", "A", "B"));
        details.Add("Frost", new EventDetail("A", "D", "E"));
        details.Add("Wildfire", new EventDetail("A", "D", "E"));
        details.Add("Flood", new EventDetail("C", "B", "C"));
        details.Add("Drought", new EventDetail("C", "B", "C"));
        details.Add("Earthquake", new EventDetail("B", "S", "B"));
        details.Add("Volcano", new EventDetail("A", "E", "A"));
        details.Add("Meteor", new EventDetail("SSS", "E", "SSS"));



        firstTime = false;
    }
Пример #8
0
    // Use this for initialization
    void Start()
    {
        map = WorldMap2D.instance;

        sprites    = new SpriteRenderer[6];
        sprites[0] = square1.GetComponent <SpriteRenderer> ();
        sprites[1] = square2.GetComponent <SpriteRenderer> ();
        sprites[2] = square3.GetComponent <SpriteRenderer> ();
        sprites[3] = square4.GetComponent <SpriteRenderer> ();
        sprites[4] = square5.GetComponent <SpriteRenderer> ();
        sprites[5] = square6.GetComponent <SpriteRenderer> ();
        //SArchive =
        //archive = SArchive.GetComponent<SpriteArchive> ();
        archive = WorldMap2D.sArchive;
    }
Пример #9
0
    void Start()
    {
        // Get a reference to the World Map API:
        map = WorldMap2D.instance;

        // UI Setup - non-important, only for this demo
        labelStyle                         = new GUIStyle();
        labelStyle.alignment               = TextAnchor.MiddleCenter;
        labelStyle.normal.textColor        = Color.white;
        labelStyleShadow                   = new GUIStyle(labelStyle);
        labelStyleShadow.normal.textColor  = Color.black;
        buttonStyle                        = new GUIStyle(labelStyle);
        buttonStyle.alignment              = TextAnchor.MiddleLeft;
        buttonStyle.normal.background      = Texture2D.whiteTexture;
        buttonStyle.normal.textColor       = Color.white;
        colorPicker                        = gameObject.GetComponent <ColorPicker> ();
        sliderStyle                        = new GUIStyle();
        sliderStyle.normal.background      = Texture2D.whiteTexture;
        sliderStyle.fixedHeight            = 4.0f;
        sliderThumbStyle                   = new GUIStyle();
        sliderThumbStyle.normal.background = Resources.Load <Texture2D> ("thumb");
        sliderThumbStyle.overflow          = new RectOffset(0, 0, 8, 0);
        sliderThumbStyle.fixedWidth        = 20.0f;
        sliderThumbStyle.fixedHeight       = 12.0f;

        // setup GUI resizer - only for the demo
        GUIResizer.Init(800, 500);

        // Register events: this is optionally but allows your scripts to be informed instantly as the mouse enters or exits a country, province or city

        /*
         * map.OnCityEnter += (int cityIndex) => Debug.Log ("Entered city " + map.cities [cityIndex].name);
         * map.OnCityExit += (int cityIndex) => Debug.Log ("Exited city " + map.cities [cityIndex].name);
         * map.OnCityClick += (int cityIndex) => Debug.Log ("Clicked city " + map.cities [cityIndex].name);
         * map.OnCountryEnter += (int countryIndex, int regionIndex) => Debug.Log ("Entered country " + map.countries [countryIndex].name);
         * map.OnCountryExit += (int countryIndex, int regionIndex) => Debug.Log ("Exited country " + map.countries [countryIndex].name);
         * map.OnCountryClick += (int countryIndex, int regionIndex) => Debug.Log ("Clicked country " + map.countries [countryIndex].name);
         * map.OnProvinceEnter += (int provinceIndex, int regionIndex) => Debug.Log ("Entered province " + map.provinces [provinceIndex].name);
         * map.OnProvinceExit += (int provinceIndex, int regionIndex) => Debug.Log ("Exited province " + map.provinces [provinceIndex].name);
         * map.OnProvinceClick += (int provinceIndex, int regionIndex) => Debug.Log ("Clicked province " + map.provinces [provinceIndex].name);
         */
        map.CenterMap();
    }
Пример #10
0
    void Start()
    {
        // Get a reference to the World Map API:
        map = WorldMap2D.instance;

        // UI Setup - non-important, only for this demo
        labelStyle                        = new GUIStyle();
        labelStyle.alignment              = TextAnchor.MiddleCenter;
        labelStyle.normal.textColor       = Color.white;
        labelStyleShadow                  = new GUIStyle(labelStyle);
        labelStyleShadow.normal.textColor = Color.black;

        /*
         * buttonStyle = new GUIStyle (labelStyle);
         *      buttonStyle.alignment = TextAnchor.MiddleLeft;
         *      buttonStyle.normal.background = Texture2D.whiteTexture;
         *      buttonStyle.normal.textColor = Color.white;
         *      colorPicker = gameObject.GetComponent<ColorPicker> ();
         *      sliderStyle = new GUIStyle ();
         *      sliderStyle.normal.background = Texture2D.whiteTexture;
         *      sliderStyle.fixedHeight = 4.0f;
         *      sliderThumbStyle = new GUIStyle ();
         *      sliderThumbStyle.normal.background = Resources.Load<Texture2D> ("thumb");
         *      sliderThumbStyle.overflow = new RectOffset (0, 0, 8, 0);
         *      sliderThumbStyle.fixedWidth = 20.0f;
         *      sliderThumbStyle.fixedHeight = 12.0f;*/

        // setup GUI resizer - only for the demo
        GUIResizer.Init(800, 500);

        map.CenterMap();         // Center map on the screen

//			map.ToggleCountrySurface("Brazil", true, Color.green);
//			map.ToggleCountrySurface(35, true, Color.green);
//			map.ToggleCountrySurface(33, true, Color.green);
//			map.FlyToCountry(33);
//			map.FlyToCountry("Brazil");

//			map.navigationTime = 0;
//			map.FlyToCountry ("India");
    }
Пример #11
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;
    }
Пример #12
0
 public void loadMod(Country c)
 {
     map        = WorldMap2D.instance;
     target     = c;
     loadStatus = true;
 }
Пример #13
0
 void Start()
 {
     map = WorldMap2D.instance;
 }
Пример #14
0
    // Use this for initialization
    void Start()
    {
        map = WorldMap2D.instance;

        map.CenterMap();
    }
Пример #15
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Country Info start");
        countryName      = GameObject.Find("CountryName").GetComponent <Text> ();
        countryName.text = "P ";
        box1             = GameObject.Find("Box1").GetComponent <Text> ();
        box1.text        = "P ";
        box2             = GameObject.Find("Box2").GetComponent <Text> ();
        box2.text        = "G ";
        box3             = GameObject.Find("Box3").GetComponent <Text> ();
        box3.text        = "P ";
        box4             = GameObject.Find("Box4").GetComponent <Text> ();
        box4.text        = "G ";
        box5             = GameObject.Find("Box5").GetComponent <Text> ();
        box5.text        = "P ";
        box6             = GameObject.Find("Box6").GetComponent <Text> ();
        box6.text        = "G ";
        box7             = GameObject.Find("Box7").GetComponent <Text> ();
        box7.text        = "G ";
        box8             = GameObject.Find("Box8").GetComponent <Text> ();
        box8.text        = "";

        modeText      = GameObject.Find("ModeText").GetComponent <Text> ();
        modeText.text = mode.ToString();


        triangles [0] = GameObject.Find("Triangle1").GetComponent <Image> ();
        triangles [1] = GameObject.Find("Triangle2").GetComponent <Image> ();
        triangles [2] = GameObject.Find("Triangle3").GetComponent <Image> ();
        triangles [3] = GameObject.Find("Triangle4").GetComponent <Image> ();
        triangles [4] = GameObject.Find("Triangle5").GetComponent <Image> ();
        triangles [5] = GameObject.Find("Triangle6").GetComponent <Image> ();
        triangles [6] = GameObject.Find("Triangle7").GetComponent <Image> ();
        for (int i = 0; i < 7; i++)
        {
            setChangeBlank(triangles [i]);
        }



        archive = SArchive.GetComponent <SpriteArchive> ();

        for (int i = 0; i < 16; i++)
        {
            iconBoxs [i] = GameObject.Find("IconBox" + (i + 1));
            icons[i]     = GameObject.Find("Icon" + (i + 1));

            iconStatus [i] = false;
        }
        icons [14].GetComponent <Image> ().color = transparentColor;
        icons [15].GetComponent <Image> ().color = transparentColor;

        prevGenerics [0] = "";
        prevGenerics [1] = "";
        prevGenerics [2] = "";



        map = WorldMap2D.instance;


        map.ErrorLog     = ErrorLog;
        map.errorMessage = ErrorMessage.GetComponent <Text> ();
        ErrorLog.SetActive(false);

        LoadingScreen.SetActive(false);
        Debug.Log("Country Info initialized");
    }
Пример #16
0
 public void setTarget(Country c)
 {
     map    = WorldMap2D.instance;
     target = c;
 }
Пример #17
0
 public void setTarget(int targetIndex)
 {
     map    = WorldMap2D.instance;
     target = map.countries[targetIndex];
     anim   = GetComponent <Animator> ();
 }
Пример #18
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent <Animator> ();
     map  = WorldMap2D.instance;
 }
Пример #19
0
    public void save()
    {
        WorldMap2D map = WorldMap2D.instance;

        map.saveGame();
    }
Пример #20
0
 void Start()
 {
     map     = WorldMap2D.instance;
     warning = GameObject.Find("ConfirmModText").GetComponent <Text> ();
 }
Пример #21
0
    private void Update()
    {
        float temp, zRotation;

        TextM = GetComponent <TextMeshProUGUI>();
        data  = GlobalTW.instance;
        map   = WorldMap2D.instance;

        switch (keyname)
        {
        case "myPro":
            TextM.text = data.countries.production[key1].ToString("F1");
            break;

        case "myPop":
            TextM.text = data.countries.population[key1].ToString("F1");
            break;

        case "myNeeds":
            TextM.text = data.countries.needs[key1].ToString("F1");
            break;

        case "facPro":
            zRotation  = 0f;
            temp       = data.countries.FactionPN[key1, key2] + data.countries.FactionPN[key1, key2 + 2] + data.countries.FactionPN[key1, key2 + 4];
            TextM.text = temp.ToString("F1");
            PieGraph.transform.GetChild(0).transform.GetComponent <Image>().fillAmount = data.countries.FactionPN[key1, key2] / temp;
            zRotation -= data.countries.FactionPN[key1, key2] / temp * 360f;
            PieGraph.transform.GetChild(1).transform.GetComponent <Image>().fillAmount         = data.countries.FactionPN[key1, key2 + 2] / temp;
            PieGraph.transform.GetChild(1).transform.GetComponent <Image>().transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, zRotation));
            zRotation -= data.countries.FactionPN[key1, key2 + 2] / temp * 360f;
            PieGraph.transform.GetChild(2).transform.GetComponent <Image>().fillAmount         = data.countries.FactionPN[key1, key2 + 4] / temp;
            PieGraph.transform.GetChild(2).transform.GetComponent <Image>().transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, zRotation));
            break;

        case "facNeeds":
            zRotation = 0f;
            if (data.countries.player == 0)
            {
                temp = data.countries.FactionPN[key1, 0];
            }
            else
            {
                temp = data.countries.FactionPN[key1, 4];
            }
            TextM.text = temp.ToString("F1");

            /*PieGraph.transform.GetChild(0).transform.GetComponent<Image>().fillAmount = 0.2f;
             * zRotation -= 0.2f * 360f;
             * PieGraph.transform.GetChild(1).transform.GetComponent<Image>().fillAmount = 0.5f;
             * PieGraph.transform.GetChild(1).transform.GetComponent<Image>().transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, zRotation));
             * zRotation -= 0.5f * 360f;
             * PieGraph.transform.GetChild(2).transform.GetComponent<Image>().fillAmount = 0.3f;
             * PieGraph.transform.GetChild(2).transform.GetComponent<Image>().transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, zRotation));*/
            break;

        case "unemployment":
            TextM.text = data.countries.unemployment.ToString();
            break;

        case "unempRate":
            temp       = data.countries.unemployment / (data.countries.unemployment + data.countries.population[0] + data.countries.population[1] + data.countries.population[2] + data.countries.population[3] + data.countries.population[4] + data.countries.population[5]);
            temp       = temp * 100;
            TextM.text = temp.ToString("F2") + "% ";
            //TextM.text = "5%";
            break;

        case "WorldTension":
            TextM.text = data.countries.WorldTension.ToString();
            break;

        case "Atax":
            TextM.text = data.countries.Atax.ToString();
            break;

        case "Ctax":
            TextM.text = data.countries.Ctax.ToString();
            break;

        case "Date":
            double year   = Math.Floor((double)data.countries.turnsN / 12) + 2018;
            string result = year + "-" + (data.countries.turnsN % 12 + 1);
            TextM.text = result;
            break;

        case "turnsN":
            TextM.text = data.countries.turnsN.ToString();
            break;

        case "LastCountryName":
            if (map.countryLastClicked != -1)
            {
                TextM.text = data.countries.names[map.countryLastClicked];
            }
            break;

        case "LastCountryStanding":
            if (map.countryLastClicked != -1)
            {
                int a = data.countries.player;
                if (a == 0)
                {
                    a = -1;
                }
                TextM.text = (data.countries.standing[map.countryLastClicked] * a).ToString("F1");
                if (data.countries.standing[map.countryLastClicked] <= -30)
                {
                    TextM.color = new Color(0.1f, 0.1f, 0.8f);
                }
                else if (data.countries.standing[map.countryLastClicked] >= 30)
                {
                    TextM.color = new Color(0.8f, 0.1f, 0.1f);
                }
                else
                {
                    TextM.color = new Color(0.2f, 0.2f, 0.2f);
                }
            }
            else
            {
                TextM.text = " ";
            }
            break;

        case "LastCountryProduct":
            if (map.countryLastClicked != -1)
            {
                TextM.text = data.countries.details[map.countryLastClicked].a[key1].ToString();
            }
            else
            {
                TextM.text = " ";
            }
            break;

        case "incStanding":
            if (map.countryLastClicked != -1)
            {
                int   total = data.countries.details[map.countryLastClicked].a[0] + data.countries.details[map.countryLastClicked].a[1] + data.countries.details[map.countryLastClicked].a[2] + data.countries.details[map.countryLastClicked].a[3];
                float relation;
                if (total > 0)
                {
                    relation = 60 / total;
                }
                else
                {
                    relation = 60;
                }
                float b;
                b = (data.countries.turnsN % 30) + 10;
                b = ((map.countryLastClicked + 20) % b + 1) / b;
                if (b >= 0.5)
                {
                    TextM.color = new Color(0.0f, 0.8f, 0.0f);
                }
                else
                {
                    TextM.color = new Color(0.8f, 0.0f, 0.0f);
                }
                relation = relation * (b * 0.8f + 0.5f);
                if (relation > 30)
                {
                    relation = 30;
                }
                TextM.text = "+" + relation.ToString("F1");
            }
            // Debug.Log(map.countryLastClicked + " " + data.countries.turnsN + " ");
            break;

            /* default:
             *   TextM.text = data.countries.production[key1].ToString();
             *   break;*/
        }
    }