コード例 #1
0
ファイル: CountryManager.cs プロジェクト: DaiGumms/Rise
    //Colour the territories
    public void TintTerritories()
    {
        print("Tinting Territories");
        //For every territory in the territory list
        for (int i = 0; i < territoryList.Count; i++)
        {
            CountryHandler handler = territoryList[i].GetComponent
                                     <CountryHandler>();

            //Purple
            if (handler.country.race == "AVIAN")
            {
                handler.TintColor(new Color32(255, 0, 255, 100));
            }
            //Blue
            if (handler.country.race == "EVREI")
            {
                handler.TintColor(new Color32(0, 0, 255, 100));
            }
            //Green
            if (handler.country.race == "HUMAN")
            {
                handler.TintColor(new Color32(0, 255, 0, 100));
            }
            //Red
            if (handler.country.race == "KABAL")
            {
                handler.TintColor(new Color32(255, 0, 0, 100));
            }
            //Yellow
            if (handler.country.race == "TENNO")
            {
                handler.TintColor(new Color32(255, 255, 0, 100));
            }
            //Cyan
            if (handler.country.race == "VORTA")
            {
                handler.TintColor(new Color32(0, 255, 255, 100));
            }
        }
        print("Territories Tinted!");
    }
コード例 #2
0
ファイル: CountryManager.cs プロジェクト: DaiGumms/Rise
    //Set the race of the selected territory in the SetUp phase
    public void SelectTerritory()
    {
        print("Changing!");
        CountryHandler select = GameObject.Find(GameManager.instance.setUpTerritory)
                                .GetComponent <CountryHandler>();

        if (GameManager.instance.currentRace == "AVIAN")
        {
            if (select.country.race == "NULL")
            {
                select.country.race = "AVIAN";
                select.TintColor(new Color32(255, 0, 255, 70));
                select.country.battalions++;
                select.SetBattalions();
                print("Owner Set to AVIAN.");
                GameManager.instance.SetUpClickValid = true;

                scoreManager.ChangeScore(GameManager.instance.currentRace, "territory", 1);
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
            else if (select.country.race == "AVIAN")
            {
                select.country.battalions++;
                select.SetBattalions();
                print("Extra battalion placed.");
                GameManager.instance.SetUpClickValid = true;
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
        }
        if (GameManager.instance.currentRace == "VORTA")
        {
            if (select.country.race == "NULL")
            {
                select.country.race = "VORTA";
                select.TintColor(new Color32(0, 255, 255, 70));
                select.country.battalions++;
                select.SetBattalions();
                print("Owner Set to VORTA.");
                GameManager.instance.SetUpClickValid = true;

                scoreManager.ChangeScore(GameManager.instance.currentRace, "territory", 1);
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
            else if (select.country.race == "VORTA")
            {
                select.country.battalions++;
                select.SetBattalions();
                print("Extra battalion placed.");
                GameManager.instance.SetUpClickValid = true;
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
        }
        if (GameManager.instance.currentRace == "KABAL")
        {
            if (select.country.race == "NULL")
            {
                select.country.race = "KABAL";
                select.TintColor(new Color32(255, 0, 0, 70));
                select.country.battalions++;
                select.SetBattalions();
                print("Owner Set to KABAL.");
                GameManager.instance.SetUpClickValid = true;

                scoreManager.ChangeScore(GameManager.instance.currentRace, "territory", 1);
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
            else if (select.country.race == "KABAL")
            {
                select.country.battalions++;
                select.SetBattalions();
                print("Extra battalion placed.");
                GameManager.instance.SetUpClickValid = true;
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
        }
        if (GameManager.instance.currentRace == "EVREI")
        {
            if (select.country.race == "NULL")
            {
                select.country.race = "EVREI";
                select.TintColor(new Color32(0, 0, 255, 70));
                select.country.battalions++;
                select.SetBattalions();
                print("Owner Set to EVREI.");
                GameManager.instance.SetUpClickValid = true;

                scoreManager.ChangeScore(GameManager.instance.currentRace, "territory", 1);
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
            else if (select.country.race == "EVREI")
            {
                select.country.battalions++;
                select.SetBattalions();
                print("Extra battalion placed.");
                GameManager.instance.SetUpClickValid = true;
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
        }
        if (GameManager.instance.currentRace == "TENNO")
        {
            if (select.country.race == "NULL")
            {
                select.country.race = "TENNO";
                select.TintColor(new Color32(255, 255, 0, 70));
                select.country.battalions++;
                select.SetBattalions();
                print("Owner Set to TENNO.");
                GameManager.instance.SetUpClickValid = true;

                scoreManager.ChangeScore(GameManager.instance.currentRace, "territory", 1);
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
            else if (select.country.race == "TENNO")
            {
                select.country.battalions++;
                select.SetBattalions();
                print("Extra battalion placed.");
                GameManager.instance.SetUpClickValid = true;
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
        }
        if (GameManager.instance.currentRace == "HUMAN")
        {
            if (select.country.race == "NULL")
            {
                select.country.race = "HUMAN";
                select.TintColor(new Color32(0, 255, 0, 70));
                select.country.battalions++;
                select.SetBattalions();
                print("Owner Set to HUMAN.");
                GameManager.instance.SetUpClickValid = true;

                scoreManager.ChangeScore(GameManager.instance.currentRace, "territory", 1);
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
            else if (select.country.race == "HUMAN")
            {
                select.country.battalions++;
                select.SetBattalions();
                print("Extra battalion placed.");
                GameManager.instance.SetUpClickValid = true;
                scoreManager.ChangeScore(GameManager.instance.currentRace, "battalions", 1);
            }
        }
    }
コード例 #3
0
    // Tints the country depending on which player is controlling it
    public void TintCountries()
    {
        byte opacity = 255;

        for (int i = 0; i < countryList.Count; i++)
        {
            CountryHandler countHandler = countryList[i].GetComponent <CountryHandler>();
            if (ManageGame.instance.playerTroopAllocate)
            {
                if (countHandler.country.controllingPlayer.ToString() != ManageGame.instance.playerTribe)
                {
                    countHandler.TintColor(new Color32(1, 1, 1, 150));
                }
            }
            else
            {
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Aborigines)
                {
                    countHandler.TintColor(new Color32(153, 116, 61, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Annunaki)
                {
                    countHandler.TintColor(new Color32(199, 113, 227, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Atlanteans)
                {
                    countHandler.TintColor(new Color32(95, 175, 237, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Babylonians)
                {
                    countHandler.TintColor(new Color32(95, 237, 185, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Celts)
                {
                    countHandler.TintColor(new Color32(206, 242, 133, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Clovis)
                {
                    countHandler.TintColor(new Color32(255, 0, 0, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Iberians)
                {
                    countHandler.TintColor(new Color32(0, 1, 200, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Maya)
                {
                    countHandler.TintColor(new Color32(255, 135, 0, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Nommo)
                {
                    countHandler.TintColor(new Color32(105, 29, 62, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Olmecs)
                {
                    countHandler.TintColor(new Color32(190, 190, 0, opacity));
                }
                if (countHandler.country.controllingPlayer == Country.ControllingPlayers.Zoroastrians)
                {
                    countHandler.TintColor(new Color32(0, 94, 13, opacity));
                }
            }
        }
    }