Ejemplo n.º 1
0
    public void Start1v1Battle(BattleTeam tOne, BattleTeam tTwo)
    {
        ResetBattle();

        battleBoard.Set3x7Board();

        battleTeams.Add(tOne);
        battleTeams.Add(tTwo);

        // Team One Positions
        if (tOne.numUnits > 0)
        {
            BodManager.instance.ResetBod(tOne.GetMember(0));
            BodToken token1 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token1.SetTokenBod(tOne.GetMember(0), false);
            battleBoard.SetBodTokenToPosition(token1, 1, 1, true);
            tokens.Add(token1);
        }
        if (tOne.numUnits > 1)
        {
            BodManager.instance.ResetBod(tOne.GetMember(1));
            BodToken token2 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token2.SetTokenBod(tOne.GetMember(1), false);
            battleBoard.SetBodTokenToPosition(token2, 1, 0, true);
            tokens.Add(token2);
        }
        if (tOne.numUnits > 2)
        {
            BodManager.instance.ResetBod(tOne.GetMember(2));
            BodToken token3 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token3.SetTokenBod(tOne.GetMember(2), false);
            battleBoard.SetBodTokenToPosition(token3, 1, 2, true);
            tokens.Add(token3);
        }
        if (tOne.numUnits > 3)
        {
            BodManager.instance.ResetBod(tOne.GetMember(3));
            BodToken token4 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token4.SetTokenBod(tOne.GetMember(3), false);
            battleBoard.SetBodTokenToPosition(token4, 0, 0, true);
            tokens.Add(token4);
        }
        if (tOne.numUnits > 4)
        {
            BodManager.instance.ResetBod(tOne.GetMember(4));
            BodToken token5 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token5.SetTokenBod(tOne.GetMember(4), false);
            battleBoard.SetBodTokenToPosition(token5, 0, 2, true);
            tokens.Add(token5);
        }

        // Team Two Positions
        if (tTwo.numUnits > 0)
        {
            BodManager.instance.ResetBod(tTwo.GetMember(0));
            BodToken token6 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token6.SetTokenBod(tTwo.GetMember(0));
            battleBoard.SetBodTokenToPosition(token6, 5, 1, true);
            tokens.Add(token6);
        }
        if (tTwo.numUnits > 1)
        {
            BodManager.instance.ResetBod(tTwo.GetMember(1));
            BodToken token7 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token7.SetTokenBod(tTwo.GetMember(1));
            battleBoard.SetBodTokenToPosition(token7, 5, 2, true);
            tokens.Add(token7);
        }
        if (tTwo.numUnits > 2)
        {
            BodManager.instance.ResetBod(tTwo.GetMember(2));
            BodToken token8 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token8.SetTokenBod(tTwo.GetMember(2));
            battleBoard.SetBodTokenToPosition(token8, 5, 0, true);
            tokens.Add(token8);
        }
        if (tTwo.numUnits > 3)
        {
            BodManager.instance.ResetBod(tTwo.GetMember(3));
            BodToken token9 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token9.SetTokenBod(tTwo.GetMember(3));
            battleBoard.SetBodTokenToPosition(token9, 6, 2, true);
            tokens.Add(token9);
        }
        if (tTwo.numUnits > 4)
        {
            BodManager.instance.ResetBod(tTwo.GetMember(4));
            BodToken token10 = Instantiate(BodManager.instance.bodTokenPrefab).GetComponent <BodToken>();
            token10.SetTokenBod(tTwo.GetMember(4));
            battleBoard.SetBodTokenToPosition(token10, 6, 0, true);
            tokens.Add(token10);
        }

        StartBattle();
    }