Exemplo n.º 1
0
    public void CreatePartyButton(int i, int memberNum)
    {
        GameObject friendlySpace = GameObject.Find("FriendlyRight" + memberNum);
        UnitStats  member        = party.playerParty[i].GetComponent <UnitStats>();

        member.battleLocation = ("FriendlyRight" + memberNum);
        member.facing         = Facing.Left;
        GameObject thisMember = member.CreateBattleAnimator(member.battlePrefab);

        thisMember.transform.parent        = friendlySpace.transform;
        thisMember.transform.localPosition = new Vector3(0, thisMember.transform.position.y, 0);
        if (!member.IsDead())
        {
            thisMember.GetComponent <Animator>().Play("BattleIdle" + member.facing.ToString());
        }
        else
        {
            thisMember.GetComponent <Animator>().Play("Dead");
        }
        GameObject mbtn = member.CreateBattleButton(partyStatButton);
        BattlePartyButtonController btn = mbtn.GetComponent <BattlePartyButtonController>();

        btn.AddParent(partyStatPanel);
        btn.member = party.playerParty[i].GetComponent <UnitStats>();
        btn.UpdateText();
        pbtns.Add(btn);
    }
Exemplo n.º 2
0
    public void CreateEnemyButton(int i)
    {
        GameObject unfriendlySpace = GameObject.Find("EnemyMid" + (i + 1));
        UnitStats  member          = enemies.enemyParty[i].GetComponent <UnitStats>();

        member.battleLocation = "EnemyMid" + (i + 1);
        member.facing         = Facing.Right;
        GameObject thisMember = member.CreateBattleAnimator(member.battlePrefab);

        thisMember.transform.parent        = unfriendlySpace.transform;
        thisMember.transform.localPosition = new Vector3(0, thisMember.transform.position.y, 0);
        thisMember.GetComponent <Animator>().Play("BattleIdle" + member.facing.ToString());
        GameObject ebtn = member.CreateBattleButton(enemyStatButton);
        BattleEnemyButtonController btn = ebtn.GetComponent <BattleEnemyButtonController>();

        btn.AddParent(enemyStatPanel);
        btn.member = enemies.enemyParty[i].GetComponent <UnitStats>();
        btn.UpdateText();
    }