Exemple #1
0
    public void UpdateDiceInfos()
    {
        GameObject dice = this.transform.GetChild(1).gameObject;

        dice.GetComponent <Image> ().color = DictionaryManager.ActionColor(this.card.tempAction.color);
        dice.transform.GetChild(0).GetComponent <Image> ().sprite = Resources.Load <Sprite> ("action_type_" + this.card.tempAction.type);
        if (this.card.tempAction.type == 1)
        {
            dice.transform.GetChild(1).GetComponent <Text> ().text = this.card.tempAction.combatActions [0].damage.ToString();
            dice.transform.GetChild(1).gameObject.SetActive(true);
            if (this.card.tempAction.combatActions.Length > 1)
            {
                dice.transform.GetChild(2).GetComponent <Text> ().text = "x" + this.card.tempAction.combatActions.Length;
                dice.transform.GetChild(2).gameObject.SetActive(true);
            }
            else
            {
                dice.transform.GetChild(2).gameObject.SetActive(false);
            }
        }
        else
        {
            dice.transform.GetChild(1).gameObject.SetActive(false);
            dice.transform.GetChild(2).gameObject.SetActive(false);
        }
    }
Exemple #2
0
    public void GenerateSupport(int newInt)
    {
        for (int i = 0; i < CampaignManager.playerTeam.supports.Length; i++)
        {
            SupportData supportScript = CampaignManager.playerTeam.supports[i];
            GameObject  supportGO     = Instantiate(this.charactrerPanelPrefab, this.characterContainer.transform.position, this.transform.rotation, this.characterContainer.transform) as GameObject;
            supportGO.name = supportScript.supportName;
            supportGO.transform.GetChild(0).GetChild(0).GetComponent <Text> ().text   = supportScript.supportName;
            supportGO.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("character_avatars/" + supportScript.idAvatar);
            supportGO.transform.GetChild(2).gameObject.SetActive(false);
            //supportGO.transform.GetChild (2).GetChild (0).GetChild (0).GetComponent<Text> ().text = supportScript.pv.ToString() + " / " + supportScript.pvMax.ToString ();
            //supportGO.transform.GetChild (2).GetChild (1).GetChild (0).GetComponent<Text> ().text = supportScript.force.ToString ();
            //supportGO.transform.GetChild (2).GetChild (2).GetChild (0).GetComponent<Text> ().text = supportScript.armure.ToString ();
            supportGO.transform.GetChild(3).GetChild(0).GetChild(0).GetComponent <Text> ().text = supportScript.nbSkillSlots.ToString();
            supportGO.transform.GetChild(3).GetChild(1).GetChild(0).GetComponent <Text> ().text = supportScript.nbDice.ToString() + " / " + supportScript.nbDiceMax.ToString();

            supportGO.GetComponent <PopupElement> ().support       = supportScript;
            supportGO.GetComponent <PopupElement> ().characterType = 2;
            supportGO.GetComponent <PopupElement> ().characterId   = i;

            if (newInt == 1)
            {
                supportGO.GetComponent <Button> ().enabled  = false;
                supportGO.GetComponent <Outline> ().enabled = false;
            }
            else
            {
                if (supportScript.nbDice == supportScript.nbDiceMax)
                {
                    supportGO.GetComponent <Button> ().enabled  = false;
                    supportGO.GetComponent <Outline> ().enabled = false;
                }
            }

            for (int j = 0; j < supportScript.nbSkillSlots; j++)
            {
                ActionsData actionTemp = DictionaryManager.GetAction(supportScript.L_skills [j]);
                GameObject  skillGO    = Instantiate(this.skillAttributionPrefab, this.transform.position, this.transform.rotation, supportGO.transform.GetChild(4)) as GameObject;

                skillGO.name = actionTemp.name;
                skillGO.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("skill_icons/" + actionTemp.id);
                skillGO.transform.GetChild(2).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("action_type_" + actionTemp.type);
                skillGO.transform.GetChild(3).GetComponent <Text> ().text = actionTemp.name;
                skillGO.GetComponent <Image> ().color                = DictionaryManager.ActionColor(actionTemp.color);
                skillGO.GetComponent <PopupElement> ().action        = actionTemp;
                skillGO.GetComponent <PopupElement> ().support       = supportScript;
                skillGO.GetComponent <PopupElement> ().characterType = 2;
                skillGO.GetComponent <PopupElement> ().characterId   = i;
                skillGO.GetComponent <PopupElement> ().teamId        = j;

                if (newInt == 2)
                {
                    skillGO.GetComponent <Button> ().enabled  = false;
                    skillGO.GetComponent <Outline> ().enabled = false;
                }
            }
        }
    }
Exemple #3
0
    public void GenerateActionsPopup()
    {
        for (int i = 0; i < DictionaryManager.actionsDictionary.Count; i++)
        {
            GameObject  actionElementTemp = Instantiate(this.actionElementPrefab, this.transform.GetChild(2).position, this.transform.rotation, this.transform.GetChild(2).GetChild(0)) as GameObject;
            ActionsData actionTemp        = DictionaryManager.actionsDictionary [i];

            actionElementTemp.name = actionTemp.name;
            actionElementTemp.transform.GetChild(0).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("skill_icons/" + actionTemp.id);
            actionElementTemp.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("action_type_" + actionTemp.type);
            actionElementTemp.transform.GetChild(2).GetComponent <Text> ().text = actionTemp.name;
            actionElementTemp.GetComponent <Image> ().color         = DictionaryManager.ActionColor(actionTemp.color);
            actionElementTemp.GetComponent <PopupElement> ().action = actionTemp;

            this.actionsGoList.Add(actionElementTemp);
        }
        this.actionsGoList.Sort(SortByName);
        for (int i = 0; i < this.actionsGoList.Count; i++)
        {
            this.actionsGoList [i].transform.SetSiblingIndex(i);
        }
    }
Exemple #4
0
 public void UpdateTalentsSlotImages()
 {
     if (this.characterType == 1 || this.characterType == 3)
     {
         for (int i = 0; i < this.summonerScript.L_talents.Count; i++)
         {
             if (this.summonerScript.L_talents [i] != 0)
             {
                 EtatsData etatTemp;
                 DictionaryManager.etatsDictionary.TryGetValue(this.summonerScript.L_talents [i], out etatTemp);
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetComponent <PopupElement> ().etat = etatTemp;
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetComponent <Image> ().color       = DictionaryManager.ActionColor(5);
                 //this.blocNbActions.transform.GetChild (0).GetChild (i).GetComponent<PopupElement> ().teamId = this.teamId;
                 //this.blocNbActions.transform.GetChild (0).GetChild (i).GetComponent<PopupElement> ().characterType = this.characterType;
                 //this.blocNbActions.transform.GetChild (0).GetChild (i).GetComponent<PopupElement> ().characterId = this.summonerScript.id;
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetChild(0).GetChild(0).GetComponent <Image> ().sprite = Resources.Load <Sprite> ("etat_icons/" + etatTemp.id);
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetChild(2).gameObject.SetActive(false);
             }
             else
             {
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetChild(2).gameObject.SetActive(true);
             }
         }
     }
     else
     {
         for (int i = 0; i < this.supportScript.L_talents.Count; i++)
         {
             if (this.supportScript.L_talents [i] != 0)
             {
                 EtatsData etatTemp;
                 DictionaryManager.etatsDictionary.TryGetValue(this.supportScript.L_talents [i], out etatTemp);
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetComponent <PopupElement> ().etat = etatTemp;
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetComponent <Image> ().color       = DictionaryManager.ActionColor(5);
                 //this.blocNbActions.transform.GetChild (0).GetChild (i).GetComponent<PopupElement> ().teamId = this.teamId;
                 //this.blocNbActions.transform.GetChild (0).GetChild (i).GetComponent<PopupElement> ().characterType = this.characterType;
                 //this.blocNbActions.transform.GetChild (0).GetChild (i).GetComponent<PopupElement> ().characterId = this.supportScript.id;
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetChild(0).GetChild(0).GetComponent <Image> ().sprite = Resources.Load <Sprite> ("etat_icons/" + etatTemp.id);
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetChild(2).gameObject.SetActive(false);
             }
             else
             {
                 this.blocNbEtats.transform.GetChild(0).GetChild(i).GetChild(2).gameObject.SetActive(true);
             }
         }
     }
 }
Exemple #5
0
 public void GenerateItems()
 {
     for (int i = 0; i < this.items.Length; i++)
     {
         if (CampaignManager.gold < this.items[i].GetComponent <PopupElement>().characterId)
         {
             this.items [i].GetComponent <Button> ().enabled = false;
             this.items [i].transform.GetChild(0).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);
         }
         else
         {
             this.items [i].GetComponent <Button> ().enabled = true;
             this.items [i].transform.GetChild(0).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);
         }
     }
 }
Exemple #6
0
    public void GenerateCards()
    {
        for (int i = 0; i < CampaignManager.cardAvailable.Length; i++)
        {
            //print (CampaignManager.cardAvailable [i].price.ToString ());
            this.cards [i].transform.GetChild(1).gameObject.SetActive(true);
            this.cards [i].transform.GetChild(2).gameObject.SetActive(true);
            this.cards [i].transform.GetChild(1).GetChild(1).GetComponent <Text> ().text = CampaignManager.cardAvailable [i].price.ToString();
            this.cards [i].transform.GetChild(2).GetComponent <PopupGenerator> ().GenerateCard(CampaignManager.cardAvailable [i]);

            if (CampaignManager.gold < CampaignManager.cardAvailable [i].price)
            {
                this.cards [i].GetComponent <Button> ().enabled = false;
                this.cards [i].transform.GetChild(1).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);
            }
            else
            {
                this.cards [i].GetComponent <Button> ().enabled = true;
                this.cards [i].transform.GetChild(1).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);
            }
        }
    }
Exemple #7
0
    public void UpdateActionsSlotImages()
    {
        if (this.summoner.id != 0)
        {
            for (int i = 0; i < this.summoner.L_skills.Count; i++)
            {
                ActionsData actionTemp = DictionaryManager.GetAction(this.summoner.L_skills [i]);

                this.skillContainer.transform.GetChild(i).GetComponent <PopupElement> ().action = actionTemp;
                this.skillContainer.transform.GetChild(i).GetComponent <Image> ().color         = DictionaryManager.ActionColor(actionTemp.color);
                this.skillContainer.transform.GetChild(i).GetChild(0).GetChild(0).GetComponent <Image> ().sprite = Resources.Load <Sprite> ("skill_icons/" + actionTemp.id);
                this.skillContainer.transform.GetChild(i).GetChild(2).gameObject.SetActive(false);
            }
        }
        else
        {
            for (int i = 0; i < this.support.L_skills.Count; i++)
            {
                ActionsData actionTemp = DictionaryManager.GetAction(this.support.L_skills [i]);

                this.skillContainer.transform.GetChild(i).GetComponent <PopupElement> ().action = actionTemp;
                this.skillContainer.transform.GetChild(i).GetComponent <Image> ().color         = DictionaryManager.ActionColor(actionTemp.color);
                this.skillContainer.transform.GetChild(i).GetChild(0).GetChild(0).GetComponent <Image> ().sprite = Resources.Load <Sprite> ("skill_icons/" + actionTemp.id);
                this.skillContainer.transform.GetChild(i).GetChild(2).gameObject.SetActive(false);
            }
        }
    }
Exemple #8
0
    public void UpdateCharactersTier()
    {
        this.supportPanel_1.SetActive(false);
        this.supportPanel_2.SetActive(false);

        this.mainSummonerPanel.transform.GetChild(0).GetComponent <Text> ().text = "Tier. " + CampaignManager.playerTeam.mainSummoner.tier.ToString();
        this.mainSummonerPanel.transform.GetChild(1).GetChild(0).GetComponent <Image> ().sprite = Resources.Load <Sprite> ("character_avatars/" + CampaignManager.playerTeam.mainSummoner.idAvatar);
        if ((CampaignManager.playerTeam.mainSummoner.tier + 1) % 3 == 0)
        {
            //this.mainSummonerPanel.transform.GetChild (3).GetComponent<Text> ().text = CampaignManager.playerTeam.mainSummoner.nbDiceMax.ToString () + "   >   " + (CampaignManager.playerTeam.mainSummoner.nbDiceMax + 1);
            this.mainSummonerPanel.transform.GetChild(3).GetComponent <Text> ().text = CampaignManager.playerTeam.mainSummoner.nbDiceMax.ToString() + "   >   " + (CampaignManager.playerTeam.mainSummoner.nbDiceMax + 1);
            this.mainSummonerPanel.transform.GetChild(5).GetComponent <Text> ().text = CampaignManager.playerTeam.mainSummoner.nbSkillSlots.ToString() + "   >   " + (CampaignManager.playerTeam.mainSummoner.nbSkillSlots + 1);
        }
        else
        {
            this.mainSummonerPanel.transform.GetChild(3).GetComponent <Text> ().text = CampaignManager.playerTeam.mainSummoner.nbDiceMax.ToString();
            this.mainSummonerPanel.transform.GetChild(5).GetComponent <Text> ().text = CampaignManager.playerTeam.mainSummoner.nbSkillSlots.ToString() + "   >   " + (CampaignManager.playerTeam.mainSummoner.nbSkillSlots + 1);
        }

        this.mainSummonerPanel.transform.GetChild(6).GetChild(1).GetComponent <Text> ().text = (3 * CampaignManager.playerTeam.mainSummoner.tier).ToString();

        if (CampaignManager.soul < (3 * CampaignManager.playerTeam.mainSummoner.tier))
        {
            this.mainSummonerPanel.GetComponent <Button> ().enabled = false;
            this.mainSummonerPanel.transform.GetChild(6).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);
        }
        else
        {
            this.mainSummonerPanel.GetComponent <Button> ().enabled = true;
            this.mainSummonerPanel.transform.GetChild(6).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);
        }

        for (int i = 0; i < CampaignManager.playerTeam.supports.Length; i++)
        {
            SupportData supportScript;
            if (i == 0)
            {
                supportScript = CampaignManager.playerTeam.supports [i];

                this.supportPanel_1.transform.GetChild(0).GetComponent <Text> ().text = "Tier. " + supportScript.tier.ToString();
                this.supportPanel_1.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("character_avatars/" + supportScript.idAvatar);

                if ((supportScript.tier + 1) % 3 == 0)
                {
                    this.supportPanel_1.transform.GetChild(3).GetComponent <Text> ().text = supportScript.nbDiceMax.ToString() + "   >   " + (supportScript.nbDiceMax + 1);
                    this.supportPanel_1.transform.GetChild(5).GetComponent <Text> ().text = supportScript.nbSkillSlots.ToString() + "   >   " + (supportScript.nbSkillSlots + 1);
                }
                else
                {
                    this.supportPanel_1.transform.GetChild(3).GetComponent <Text> ().text = supportScript.nbDiceMax.ToString();
                    this.supportPanel_1.transform.GetChild(5).GetComponent <Text> ().text = supportScript.nbSkillSlots.ToString() + "   >   " + (supportScript.nbSkillSlots + 1);
                }

                this.supportPanel_1.transform.GetChild(6).GetChild(1).GetComponent <Text> ().text = (3 * supportScript.tier).ToString();

                if (CampaignManager.soul < (3 * supportScript.tier))
                {
                    this.supportPanel_1.GetComponent <Button> ().enabled = false;
                    this.supportPanel_1.transform.GetChild(6).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);
                }
                else
                {
                    this.supportPanel_1.GetComponent <Button> ().enabled = true;
                    this.supportPanel_1.transform.GetChild(6).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);
                }

                this.supportPanel_1.SetActive(true);
            }
            else
            {
                supportScript = CampaignManager.playerTeam.supports [i];

                this.supportPanel_2.transform.GetChild(0).GetComponent <Text> ().text = "Tier. " + supportScript.tier.ToString();
                this.supportPanel_2.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite> ("character_avatars/" + supportScript.idAvatar);

                if ((supportScript.tier + 1) % 3 == 0)
                {
                    this.supportPanel_2.transform.GetChild(3).GetComponent <Text> ().text = supportScript.nbDiceMax.ToString() + "   >   " + (supportScript.nbDiceMax + 1);
                    this.supportPanel_2.transform.GetChild(5).GetComponent <Text> ().text = supportScript.nbSkillSlots.ToString() + "   >   " + (supportScript.nbSkillSlots + 1);
                }
                else
                {
                    this.supportPanel_2.transform.GetChild(3).GetComponent <Text> ().text = supportScript.nbDiceMax.ToString();
                    this.supportPanel_2.transform.GetChild(5).GetComponent <Text> ().text = supportScript.nbSkillSlots.ToString() + "   >   " + (supportScript.nbSkillSlots + 1);
                }

                this.supportPanel_2.transform.GetChild(6).GetChild(1).GetComponent <Text> ().text = (3 * supportScript.tier).ToString();

                if (CampaignManager.soul < (3 * supportScript.tier))
                {
                    this.supportPanel_2.GetComponent <Button> ().enabled = false;
                    this.supportPanel_2.transform.GetChild(6).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);
                }
                else
                {
                    this.supportPanel_2.GetComponent <Button> ().enabled = true;
                    this.supportPanel_2.transform.GetChild(6).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);
                }

                this.supportPanel_2.SetActive(true);
            }
        }
    }
Exemple #9
0
    public void UpdateStatsUpgrades()
    {
        this.pvPanel.transform.GetChild(2).GetComponent <Text>().text = CampaignManager.playerTeam.mainSummoner.pvMax + "   >   " + (CampaignManager.playerTeam.mainSummoner.pvMax + 5);
        this.pvPanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().text = "150";

        this.forcePanel.transform.GetChild(2).GetComponent <Text>().text = CampaignManager.playerTeam.mainSummoner.force + "   >   " + (CampaignManager.playerTeam.mainSummoner.force + 1);
        this.forcePanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().text = "150";

        this.armurePanel.transform.GetChild(2).GetComponent <Text>().text = CampaignManager.playerTeam.mainSummoner.armure + "   >   " + (CampaignManager.playerTeam.mainSummoner.armure + 1);
        this.armurePanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().text = "150";

        if (CampaignManager.gold < 150)
        {
            this.pvPanel.GetComponent <Button> ().enabled = false;
            this.pvPanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);

            this.forcePanel.GetComponent <Button> ().enabled = false;
            this.forcePanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);

            this.armurePanel.GetComponent <Button> ().enabled = false;
            this.armurePanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(1);
        }
        else
        {
            this.pvPanel.GetComponent <Button> ().enabled = true;
            this.pvPanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);

            this.forcePanel.GetComponent <Button> ().enabled = true;
            this.forcePanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);

            this.armurePanel.GetComponent <Button> ().enabled = true;
            this.armurePanel.transform.GetChild(3).GetChild(1).GetComponent <Text> ().color = DictionaryManager.ActionColor(2);
        }
    }