コード例 #1
0
    void Update()
    {
        if (!spawned)
        {
            troopInfo = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
            SetUnit();
            SetChariot();
            //SetItemTag();
            if (isPlayer)
            {
                unitPrefab = manPrefab;
            }
            else if (!isPlayer & isAlly)
            {
                captainClone = Instantiate(manPrefab, transform.GetChild(1).transform.position, transform.rotation);
                unitPrefab   = manPrefab;
                captainClone.GetComponent <AIClass>().name = leader;
            }
            else if (!isPlayer & !isAlly)
            {
                captainClone = Instantiate(manPrefab, transform.GetChild(1).transform.position, transform.rotation);
                unitPrefab   = manPrefab;

                captainClone.tag   = "Enemy";
                captainClone.layer = LayerMask.NameToLayer("Enemy");
                captainClone.GetComponent <AIClass>().name = leader;
                captainClone.GetComponent <AIFight>().head.GetComponent <SpriteRenderer>().color      = new Color(0.75f, 0.25f, 0.25f, 1);
                captainClone.GetComponent <AIFight>().body.GetComponent <SpriteRenderer>().color      = new Color(0.75f, 0.25f, 0.25f, 1);
                captainClone.GetComponent <AIFight>().leftHand.GetComponent <SpriteRenderer>().color  = new Color(0.75f, 0.25f, 0.25f, 1);
                captainClone.GetComponent <AIFight>().rightHand.GetComponent <SpriteRenderer>().color = new Color(0.75f, 0.25f, 0.25f, 1);
            }
            SpawnUnit();
            spawned = true;
        }
    }
コード例 #2
0
    void showNew()
    {
        newIcon.texture   = TroopImgDataBase.troopImgDataBase.getTroopIcon(newPerson.faction, newPerson.troopType, newPerson.ranking);
        newRanking.text   = TroopDataBase.rankingToString(newPerson.ranking);
        newTroopType.text = TroopDataBase.troopTypeToString(newPerson.troopType);
        TroopInfo troopInfo = TroopDataBase.troopDataBase.getTroopInfo(newPerson.faction, newPerson.troopType, newPerson.ranking);

        newArmor.text    = (troopInfo.gear.armorRating).ToString();
        newEvasion.text  = (troopInfo.gear.evasionRating).ToString();
        newBlock.text    = (troopInfo.gear.blockRating).ToString();
        newVision.text   = (troopInfo.gear.visionRating).ToString();
        newStealth.text  = (troopInfo.gear.stealthRating).ToString();
        newAccuracy.text = (troopInfo.gear.accuracyRating).ToString();
        newMelee.text    = (troopInfo.gear.meleeDmgRating).ToString();
        newRanged.text   = ((troopInfo.gear.rangedDmgRating + troopInfo.gear.accuracyRating) / 2).ToString();
        newMobility.text = (troopInfo.gear.mobilityRating).ToString();

        newArmorBar.rectTransform.sizeDelta    = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.armorRating) / 10);
        newEvasionBar.rectTransform.sizeDelta  = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.evasionRating) / 10);
        newBlockBar.rectTransform.sizeDelta    = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.blockRating) / 10);
        newVisionBar.rectTransform.sizeDelta   = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.visionRating) / 10);
        newStealthBar.rectTransform.sizeDelta  = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.stealthRating) / 10);
        newAccuracyBar.rectTransform.sizeDelta = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.accuracyRating) / 10);
        newMeleeBar.rectTransform.sizeDelta    = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.meleeDmgRating) / 10);
        newRangedBar.rectTransform.sizeDelta   = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.rangedDmgRating) / 20);
        newMobilityBar.rectTransform.sizeDelta = new Vector2(STATS_BAR_WIDTH, STATS_BAR_HEIGHT * (troopInfo.gear.armorRating) / 10);
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        weapon = GetComponent <Weapon>();
        armor  = GetComponent <Armor>();

        if (isMainHand | isOffHand | isTwohanded)
        {
            weapon.enabled = true;
            armor.enabled  = false;
            GetAttributeFromWeaponDatabase();
        }
        else if (isArmor | isHelmet | isShield)
        {
            armor.enabled  = true;
            weapon.enabled = false;
            GetAttributeFromArmorDatabase();
        }
        else if (isMount)
        {
            GetAttributeFromMountDatabase();
        }


        //itemSeletion = transform.parent.parent.parent.GetComponent<ItemSeletion>();
        nameText  = GetComponentInChildren <Text>();
        troopInfo = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();

        SetPreviewImage();
        SetPrice();
    }
コード例 #4
0
    void SpawnPlayerUnits()
    {
        TroopInfo troopInfo = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();

        if (troopInfo.playerUnits)
        {
            for (int i = 0; i < troopInfo.playerUnits.childCount; i++)
            {
                print("SpawnPlayerUnits");
                unitClone = Instantiate(unitPrefab, transform.GetChild(i).transform.position, transform.rotation);
                unitClone.GetComponent <AIClass>().name         = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().name;
                unitClone.GetComponent <AIClass>().level        = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().level;
                unitClone.GetComponent <AIClass>().offHand.tag  = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().offHandTag;
                unitClone.GetComponent <AIClass>().mainHand.tag = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().mainHandTag;
                unitClone.GetComponent <AIClass>().mainHandItem = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().mainHandItem;
                unitClone.GetComponent <AIClass>().offHandItem  = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().offHandItem;
                unitClone.GetComponent <Armor>().armorType      = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().armorType;
                unitClone.GetComponent <Armor>().helmetType     = troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().helmetType;
                if (troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().mounted)
                {
                    if (troopInfo.playerUnits.GetChild(i).GetComponent <Unit>().mountType == "Boar")
                    {
                        horseClone = Instantiate(boarPrefab, transform.GetChild(i).transform.position, transform.rotation);
                    }
                    else
                    {
                        horseClone = Instantiate(horsePrefab, transform.GetChild(i).transform.position, transform.rotation);
                    }
                }
                unitClone.GetComponent <AIClass>().unitCard = troopInfo.playerUnits.GetChild(i).gameObject;
                SetLeader(unitClone);
            }
        }
        else
        {
            for (int i = 2; i < a + 2; i++)
            {
                unitClone = Instantiate(unitPrefab, transform.GetChild(i).transform.position, transform.rotation);
                SpawnA(i);
                SetEnemy();
            }
            for (int i = a + 2; i < a + b + 2; i++)
            {
                unitClone = Instantiate(unitPrefab, transform.GetChild(i).transform.position, transform.rotation);
                SpawnB(i);
                SetEnemy();
            }
            for (int i = a + b + 2; i < a + b + c + 2; i++)
            {
                unitClone = Instantiate(unitPrefab, transform.GetChild(i).transform.position, transform.rotation);
                SpawnC(i);
                SetEnemy();
            }
        }
    }
コード例 #5
0
    public void SetTroop(GameObject newTroop)
    {
        troopImage.enabled = true;
        troopCount.enabled = true;

        troopPrefab = newTroop;
        troopInfo   = newTroop.GetComponent <TroopInfo>();

        troopImage.sprite = troopInfo.sprite;
        troopCount.text   = troopInfo.count.ToString();
    }
コード例 #6
0
    // Use this for initialization

    void Start()
    {
        troopInfo = this;
        if (SceneManager.GetActiveScene().name == "TroopEdit")
        {
            //GameObject.DontDestroyOnLoad(gameObject);
            sceneSwitch = false;
            CheckTroopInfo();
        }

        SetTag();
        SetUnit();
        SetAITroop();
    }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     gold               = 1000;
     currentGold        = gold;
     goldText.text      = gold + " ";
     itemSeletion       = this;
     troopInfo          = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
     currentEditingUnit = null;
     CloseUnitItemSeletion();
     manPreviewA = transform.GetChild(0).GetChild(1);
     manPreviewB = transform.GetChild(1).GetChild(1);
     manPreviewC = transform.GetChild(2).GetChild(1);
     unitACost   = transform.GetChild(0).GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetComponent <Text>();
     unitBCost   = transform.GetChild(1).GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetComponent <Text>();
     unitCCost   = transform.GetChild(2).GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetComponent <Text>();
 }
コード例 #8
0
 // Use this for initialization
 void Start()
 {
     //Add Troop Model
     troopInfo   = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
     troopModels = new List <string>()
     {
         "Ramdom", "Bandits (Few)", "Deserters (Few)",
         "Mounted Bandits (Few)", "Deserters (Gang)",
         "Garrison (Gang)", "Nomad (Few)", "Nomad (Gang)",
         "Deserters (Army)",
     };
     ally1List.AddOptions(troopModels);
     ally2List.AddOptions(troopModels);
     enemy1List.AddOptions(troopModels);
     enemy2List.AddOptions(troopModels);
     enemy3List.AddOptions(troopModels);
 }
コード例 #9
0
    public void MakeTroop(eTroopType type, eCountry country, int x, int y)
    {
        TroopInfo ti = troopData.GetTroopInfo(type, country);

        GameObject troopGo = Instantiate(ti.prefab, transform);

        troopGo.transform.localPosition = GridToPosition(x, y);

        Troop t = troopGo.GetComponent <Troop>();

        t.type    = type;
        t.country = country;
        t.x       = x;
        t.y       = y;

        t.SetTapCallback(onTapTroop);
        t.sortingGroup.sortingOrder = GetTroopOrder(x, y);

        t.FINISH_ACTION = true;

        mapTiles[x + "_" + y].troop = t;
    }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     //itemSeletion = transform.parent.GetComponent<ItemSeletion>();
     troopInfo = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
 }
コード例 #11
0
    public TroopInfo imperialGetTroopInfoHelper(TroopType tt, Ranking rk)
    {
        TroopInfo result = new TroopInfo();

        switch (tt)
        {
        case TroopType.recruitType:
            result.icon = imperialRecruitIcon;
            break;

        case TroopType.crossbowman:
            switch (rk)
            {
            case Ranking.militia:
                result.icon = imperialMilitiaCrossbowmanIcon;
                break;

            case Ranking.veteran:
                result.icon = imperialVeteranCrossbowmanIcon;
                break;

            case Ranking.elite:
                result.icon = imperialEliteCrossbowmanIcon;
                break;
            }
            break;

        case TroopType.musketeer:
            switch (rk)
            {
            case Ranking.militia:
                result.icon = imperialMilitiaMusketeerIcon;
                break;

            case Ranking.veteran:
                result.icon = imperialVeteranMusketeerIcon;
                break;

            case Ranking.elite:
                result.icon = imperialEliteMusketeerIcon;
                break;
            }
            break;

        case TroopType.swordsman:
            switch (rk)
            {
            case Ranking.militia:
                result.icon = imperialMilitiaSwordsmanIcon;
                break;

            case Ranking.veteran:
                result.icon = imperialVeteranSwordsmanIcon;
                break;

            case Ranking.elite:
                result.icon = imperialEliteSwordsmanIcon;
                break;
            }
            break;

        case TroopType.halberdier:
            switch (rk)
            {
            case Ranking.militia:
                result.icon = imperialMilitiaHalberdierIcon;
                break;

            case Ranking.veteran:
                result.icon = imperialVeteranHalberdierIcon;
                break;

            case Ranking.elite:
                result.icon = imperialEliteHalberdierIcon;
                break;
            }
            break;

        case TroopType.cavalry:
            switch (rk)
            {
            case Ranking.militia:
                result.icon = imperialMilitiaCavalryIcon;
                break;

            case Ranking.veteran:
                result.icon = imperialVeteranCavalryIcon;
                break;

            case Ranking.elite:
                result.icon = imperialEliteCavalryIcon;
                break;
            }
            break;
        }
        return(result);
    }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     costText  = GetComponentInChildren <Text>();
     troopInfo = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
 }
コード例 #13
0
    public TroopInfo mercGetTroopInfoHelper(TroopType tt, Ranking rk)
    {
        TroopInfo result = new TroopInfo();

        if (rk == Ranking.mainChar)
        {
            if (tt == TroopType.mainCharType)
            {
                result.battleValue = 0;
                result.model       = mainCharacter;
                result.gear        = new GearInfo(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
            }
            else
            {
                result.battleValue = 0;
                result.model       = secCharacter;
                result.gear        = new GearInfo(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
            }
            return(result);
        }
        switch (tt)
        {
        case TroopType.recruitType:
            result.battleValue = 10;
            result.model       = mercenaryRecruit;
            result.gear        = new GearInfo(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f);

            break;

        case TroopType.crossbowman:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = mercenaryMilitiaCrossbowman;
                result.gear        = new GearInfo(2.0f, 1.0f, 3.0f, 4.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f);
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = mercenaryVeteranCrossbowman;
                result.gear        = new GearInfo(4.0f, 2.0f, 5.0f, 6.0f, 6.0f, 7.0f, 2.0f, 4.0f, 6.0f);
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = mercenaryEliteCrossbowman;
                result.gear        = new GearInfo(7.0f, 4.0f, 8.0f, 8.0f, 8.0f, 9.0f, 4.0f, 7.0f, 8.0f);
                break;
            }
            break;

        case TroopType.musketeer:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 40;
                result.model       = mercenaryMilitiaMusketeer;
                result.gear        = new GearInfo(2.0f, 1.0f, 3.0f, 4.0f, 1.0f, 2.0f, 1.0f, 3.0f, 2.0f);
                break;

            case Ranking.veteran:
                result.battleValue = 80;
                result.model       = mercenaryVeteranMusketeer;
                result.gear        = new GearInfo(4.0f, 2.0f, 3.0f, 4.0f, 4.0f, 5.0f, 3.0f, 7.0f, 5.0f);
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = mercenaryEliteMusketeer;
                result.gear        = new GearInfo(7.0f, 5.0f, 8.0f, 7.0f, 7.0f, 7.0f, 5.0f, 9.0f, 7.0f);
                break;
            }
            break;

        case TroopType.swordsman:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = mercenaryMilitiaSwordsman;
                result.gear        = new GearInfo(3.0f, 2.0f, 3.0f, 1.0f, 3.0f, 0.0f, 4.0f, 0.0f, 3.0f);
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = mercenaryVeteranSwordsman;
                result.gear        = new GearInfo(5.0f, 5.0f, 6.0f, 2.0f, 7.0f, 0.0f, 7.0f, 0.0f, 7.0f);
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = mercenaryEliteSwordsman;
                result.gear        = new GearInfo(8.0f, 7.0f, 8.0f, 5.0f, 9.0f, 0.0f, 9.0f, 0.0f, 9.0f);
                break;
            }
            break;

        case TroopType.halberdier:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = mercenaryMilitiaHalberdier;
                result.gear        = new GearInfo(4.0f, 4.0f, 1.0f, 2.0f, 1.0f, 0.0f, 4.0f, 0.0f, 1.0f);
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = mercenaryVeteranHalberdier;
                result.gear        = new GearInfo(7.0f, 7.0f, 2.0f, 3.0f, 2.0f, 0.0f, 7.0f, 0.0f, 4.0f);
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = mercenaryEliteHalberdier;
                result.gear        = new GearInfo(9.0f, 9.0f, 4.0f, 6.0f, 5.0f, 0.0f, 9.0f, 0.0f, 6.0f);
                break;
            }
            break;

        case TroopType.cavalry:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 40;
                result.model       = mercenaryMilitiaCavalry;
                result.gear        = new GearInfo(4.0f, 4.0f, 1.0f, 2.0f, 1.0f, 0.0f, 4.0f, 0.0f, 3.0f);
                break;

            case Ranking.veteran:
                result.battleValue = 80;
                result.model       = mercenaryVeteranCavalry;
                result.gear        = new GearInfo(6.0f, 6.0f, 4.0f, 5.0f, 3.0f, 0.0f, 7.0f, 0.0f, 6.0f);
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = mercenaryEliteCavalry;
                result.gear        = new GearInfo(9.0f, 9.0f, 6.0f, 7.0f, 7.0f, 0.0f, 10.0f, 0.0f, 9.0f);
                break;
            }
            break;
        }
        return(result);
    }
コード例 #14
0
    public TroopInfo imperialGetTroopInfoHelper(TroopType tt, Ranking rk)
    {
        TroopInfo result = new TroopInfo();

        switch (tt)
        {
        case TroopType.recruitType:
            result.battleValue = 10;
            result.model       = imperialRecruit;
            break;

        case TroopType.crossbowman:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = imperialMilitiaCrossbowman;
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = imperialVeteranCrossbowman;
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = imperialEliteCrossbowman;
                break;
            }
            break;

        case TroopType.musketeer:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = imperialMilitiaMusketeer;
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = imperialVeteranMusketeer;
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = imperialEliteMusketeer;
                break;
            }
            break;

        case TroopType.swordsman:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = imperialMilitiaSwordsman;
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = imperialVeteranSwordsman;
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = imperialEliteSwordsman;
                break;
            }
            break;

        case TroopType.halberdier:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = imperialMilitiaHalberdier;
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = imperialVeteranHalberdier;
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = imperialEliteHalberdier;
                break;
            }
            break;

        case TroopType.cavalry:
            switch (rk)
            {
            case Ranking.militia:
                result.battleValue = 20;
                result.model       = imperialMilitiaCavalry;
                break;

            case Ranking.veteran:
                result.battleValue = 50;
                result.model       = imperialVeteranCavalry;
                break;

            case Ranking.elite:
                result.battleValue = 150;
                result.model       = imperialEliteCavalry;
                break;
            }
            break;
        }
        result.gear = new GearInfo(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
        return(result);
    }
コード例 #15
0
 void FindTroopInfo()
 {
     troopInfo = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
 }
コード例 #16
0
    public TroopInfo mercGetTroopInfoHelper(TroopType tt, Ranking rk)
    {
        TroopInfo result = new TroopInfo();

        if (rk == Ranking.mainChar)
        {
            if (tt == TroopType.mainCharType)
            {
                result.icon    = mainCharacterIcon;
                result.profile = mainCharacterProfile;
            }
            else
            {
                result.icon    = secCharacterIcon;
                result.profile = secCharacterProfile;
            }
            return(result);
        }
        switch (tt)
        {
        case TroopType.recruitType:
            result.icon    = mercenaryRecruitIcon;
            result.profile = mercenaryRecruitProfile;
            break;

        case TroopType.crossbowman:
            switch (rk)
            {
            case Ranking.militia:
                result.icon    = mercenaryMilitiaCrossbowmanIcon;
                result.profile = mercenaryMilitiaCrossbowmanProfile;
                break;

            case Ranking.veteran:
                result.icon    = mercenaryVeteranCrossbowmanIcon;
                result.profile = mercenaryVeteranCrossbowmanProfile;
                break;

            case Ranking.elite:
                result.icon    = mercenaryEliteCrossbowmanIcon;
                result.profile = mercenaryEliteCrossbowmanProfile;
                break;
            }
            break;

        case TroopType.musketeer:
            switch (rk)
            {
            case Ranking.militia:
                result.icon    = mercenaryMilitiaMusketeerIcon;
                result.profile = mercenaryMilitiaMusketeerProfile;
                break;

            case Ranking.veteran:
                result.icon    = mercenaryVeteranMusketeerIcon;
                result.profile = mercenaryVeteranMusketeerProfile;
                break;

            case Ranking.elite:
                result.icon    = mercenaryEliteMusketeerIcon;
                result.profile = mercenaryEliteMusketeerProfile;
                break;
            }
            break;

        case TroopType.swordsman:
            switch (rk)
            {
            case Ranking.militia:
                result.icon    = mercenaryMilitiaSwordsmanIcon;
                result.profile = mercenaryMilitiaSwordsmanProfile;
                break;

            case Ranking.veteran:
                result.icon    = mercenaryVeteranSwordsmanIcon;
                result.profile = mercenaryVeteranSwordsmanProfile;
                break;

            case Ranking.elite:
                result.icon    = mercenaryEliteSwordsmanIcon;
                result.profile = mercenaryEliteSwordsmanProfile;
                break;
            }
            break;

        case TroopType.halberdier:
            switch (rk)
            {
            case Ranking.militia:
                result.icon    = mercenaryMilitiaHalberdierIcon;
                result.profile = mercenaryMilitiaHalberdierProfile;
                break;

            case Ranking.veteran:
                result.icon    = mercenaryVeteranHalberdierIcon;
                result.profile = mercenaryVeteranHalberdierProfile;
                break;

            case Ranking.elite:
                result.icon    = mercenaryEliteHalberdierIcon;
                result.profile = mercenaryEliteHalberdierProfile;
                break;
            }
            break;

        case TroopType.cavalry:
            switch (rk)
            {
            case Ranking.militia:
                result.icon    = mercenaryMilitiaCavalryIcon;
                result.profile = mercenaryMilitiaCavalryProfile;
                break;

            case Ranking.veteran:
                result.icon    = mercenaryVeteranCavalryIcon;
                result.profile = mercenaryVeteranCavalryProfile;
                break;

            case Ranking.elite:
                result.icon    = mercenaryEliteCavalryIcon;
                result.profile = mercenaryEliteCavalryProfile;
                break;
            }
            break;
        }
        return(result);
    }
コード例 #17
0
 // Use this for initialization
 void Start()
 {
     troopInfo  = GameObject.FindWithTag("TroopInfo").GetComponent <TroopInfo>();
     troopScale = this;
 }