Exemplo n.º 1
0
    public void InitView(UI_Character view, ETeamType side, int id)
    {
        m_UICharacter = view;

        if (side == ETeamType.LeftSide)
        {
            var pupilInfo = PupilProxy.instance.getPupilInfo(id);
            var deploy    = PupilDeploy.GetInfo(pupilInfo.DId);
            var sex       = (deploy.Sex == ESex.Man) ? 1 : 2;
            var prefab    = Resources.Load("Fight/FightPupil_" + sex);
            var go        = UnityEngine.Object.Instantiate(prefab) as GameObject;
            go.transform.localScale = new Vector3(100, 100, 1);
            view.m_Body.SetNativeObject(new GoWrapper(go));
            view.BodyObject = go;
            go.transform.GetChild(0).GetComponent <UnityArmatureComponent>().armature.flipX = side == ETeamType.LeftSide;
        }
        else
        {
            var prefab = Resources.Load("Fight/FightNpc_" + id);
            var go     = UnityEngine.Object.Instantiate(prefab) as GameObject;
            go.transform.localScale = new Vector3(100, 100, 1);
            view.m_Body.SetNativeObject(new GoWrapper(go));
            view.BodyObject = go;
            go.transform.GetChild(0).GetComponent <UnityArmatureComponent>().armature.flipX = side == ETeamType.LeftSide;
        }

        m_UICharacter.InitHp(m_MaxHp, m_CurHp);
    }
Exemplo n.º 2
0
    protected void AddTeam(int id, ETeamType type)
    {
        var team = new TeamController();

        team.TeamType = type;
        m_TeamList.Add(team);

        if (type == ETeamType.LeftSide)
        {
            var pupilId   = AdventureProxy.instance.GetData().PupilId;
            var pupilInfo = PupilProxy.instance.getPupilInfo(pupilId);
            var wuxue     = pupilInfo.GetEquipingWuXue();

            var character = team.AddCharacter(1, pupilId);
            character.TeamType = type;
            character.InitHp(200, 200);
            character.SkillId = wuxue != null ? wuxue.Id : 0;

            var normalAttack = new NormalAttack();
            normalAttack.AttackCount  = 1;
            normalAttack.AttackHurt   = 20;
            normalAttack.AttackTarget = null;
            character.InitNormalAttack(normalAttack);

            var skillAttack = new SkillAttack();
            skillAttack.AttackCount  = 4;
            skillAttack.AttackHurt   = 10;
            skillAttack.AttackTarget = null;
            skillAttack.SkillId      = character.SkillId;
            character.InitSkillAttack(skillAttack);
        }
        else
        {
            var character = team.AddCharacter(2, m_EnemyId);
            character.TeamType = type;
            character.InitHp(200, 200);
            character.SkillId = EnemyDeploy.GetInfo(m_EnemyId).SkillEffectId;

            var normalAttack = new NormalAttack();
            normalAttack.AttackCount  = 1;
            normalAttack.AttackHurt   = 10;
            normalAttack.AttackTarget = null;
            character.InitNormalAttack(normalAttack);

            var skillAttack = new SkillAttack();
            skillAttack.AttackCount  = 4;
            skillAttack.AttackHurt   = 5;
            skillAttack.AttackTarget = null;
            skillAttack.SkillId      = character.SkillId;
            character.InitSkillAttack(skillAttack);
        }
    }