Exemplo n.º 1
0
    public void LoadMonsters()
    {
        EnemyTeam[] enemyTeamTemp = JsonSave.LoadEnemyTeam();
        enemyTeam = enemyTeamTemp [0];

        Transform parentPos = GameObject.Find("_characters_pos").transform.GetChild(2);

        int nbMonsters = 0;

        for (int i = 0; i < enemyTeam.enemies.Length; i++)
        {
            GameObject          summonerGO           = Instantiate(this.enemyPrefab, parentPos.transform.GetChild(nbMonsters).transform.position, this.transform.rotation, parentPos) as GameObject;
            GameObject          characterInfosGO     = Instantiate(this.characterInfosPrefab, this.transform.position, this.transform.rotation) as GameObject;
            Summoner            summonerScript       = summonerGO.GetComponent <Summoner> ();
            CharacterInfosPanel characterInfosScript = characterInfosGO.GetComponent <CharacterInfosPanel> ();

            summonerGO.transform.localScale = new Vector3(-summonerGO.transform.localScale.x, summonerGO.transform.localScale.y, summonerGO.transform.localScale.z);

            this.CreateCharacter(summonerScript, enemyTeam.enemies[i]);
            summonerGO.name = enemyTeam.enemies [i].summonerName;
            summonerScript.charactersInfosPanel = characterInfosGO;
            summonerScript.cardTarget           = L_Summoners [0];
            summonerScript.Init();
            characterInfosScript.Init(summonerGO, 3);

            L_Enemies.Add(summonerGO);
            nbMonsters += 1;
        }
    }
Exemplo n.º 2
0
    public void LoadSupports(SupportData[] newSupportList, GameObject newSummoner)
    {
        Summoner  summonerScriptTemp = newSummoner.GetComponent <Summoner> ();
        Transform parentPos          = GameObject.Find("_characters_pos").transform.GetChild(1);

        int nbSupport = 0;

        for (int i = 0; i < newSupportList.Length; i++)
        {
            GameObject          supportGO            = Instantiate(this.supportPrefab, parentPos.transform.GetChild(nbSupport).transform.position, this.transform.rotation, parentPos) as GameObject;
            GameObject          characterInfosGO     = Instantiate(this.supportInfosPrefab, this.transform.position, this.transform.rotation) as GameObject;
            Support             supportScript        = supportGO.GetComponent <Support> ();
            CharacterInfosPanel characterInfosScript = characterInfosGO.GetComponent <CharacterInfosPanel> ();

            supportGO.name                 = newSupportList [i].supportName;
            supportScript.id               = newSupportList [i].id;
            supportScript.idOriginal       = newSupportList [i].idOriginal;
            supportScript.supportName      = newSupportList [i].supportName;
            supportScript.idAvatar         = newSupportList [i].idAvatar;
            supportScript.avatarImg.sprite = Resources.Load <Sprite> ("character_avatars/" + supportScript.idAvatar);
            supportScript.characterType    = newSupportList [i].characterType;
            supportScript.tier             = newSupportList [i].tier;

            supportScript.nbDiceMax = newSupportList [i].nbDiceMax;
            supportScript.nbDice    = newSupportList [i].nbDice;

            supportScript.nbSkillSlots = newSupportList [i].nbSkillSlots;
            supportScript.L_skills     = newSupportList [i].L_skills;
            supportScript.L_talents    = newSupportList [i].L_talents;
            supportScript.L_etats      = newSupportList [i].L_etats;

            supportScript.charactersInfosPanel = characterInfosGO;

            supportScript.Init();
            characterInfosScript.Init(supportGO, 2);

            summonerScriptTemp.L_supports.Add(supportGO);
            nbSupport += 1;
        }
    }
Exemplo n.º 3
0
    public void LoadSummoners(SummonerData newSummoner)
    {
        Transform parentPos = GameObject.Find("_characters_pos").transform.GetChild(0);

        int nbSummoner = 0;

        GameObject          summonerGO           = Instantiate(this.summonerPrefab, parentPos.transform.GetChild(nbSummoner).transform.position, this.transform.rotation, parentPos) as GameObject;
        GameObject          characterInfosGO     = Instantiate(this.characterInfosPrefab, this.transform.position, this.transform.rotation) as GameObject;
        Summoner            summonerScript       = summonerGO.GetComponent <Summoner> ();
        CharacterInfosPanel characterInfosScript = characterInfosGO.GetComponent <CharacterInfosPanel> ();

        this.CreateCharacter(summonerScript, newSummoner);
        summonerGO.name = newSummoner.summonerName;
        summonerScript.avatarImg.sprite     = Resources.Load <Sprite> ("character_avatars/" + summonerScript.idAvatar);
        summonerScript.charactersInfosPanel = characterInfosGO;
        summonerScript.Init();
        characterInfosScript.Init(summonerGO, 1);

        L_Summoners.Add(summonerGO);
        this.LoadSupports(playerTeam.supports, summonerGO);
        nbSummoner += 1;
    }
Exemplo n.º 4
0
 public void ShowZone(Card newCard)
 {
     if (this.isCharacterZone)
     {
         CharacterInfosPanel characterInfosPanelScript = this.GetComponent <CharacterInfosPanel> ();
         if (characterInfosPanelScript.characterGameobject != null)
         {
             //print ("la zone de " + this.characterScript.summonerName + " est activee");
             if (characterInfosPanelScript.characterScript.characterType == 3 && newCard.action.targetType == 2)
             {
                 this.zone.SetActive(true);
             }
         }
     }
     else
     {
         if (newCard.action.targetType == 1 || newCard.action.targetType == 3)
         {
             this.zone.SetActive(true);
         }
     }
 }