Ejemplo n.º 1
0
    public void addLittleBoss(string enemyId, int index, int rareWeight)
    {
        Transform s;

        s            = Instantiate(enemyPrefab) as Transform;
        s.localScale = Vector3.zero;
        s.gameObject.SetActive(false);
        s.SetParent(enemyParent);
        s.position = getPosByIndex(index, true);
        s.name     = SDConstants.ENEMY_TAG + enemyId + "POS" + index;
        BattleRoleData unit = s.GetComponent <BattleRoleData>();

        unit.posIndex = SDConstants.MaxSelfNum;
        //
        unit.IsBoss       = true;
        unit.isLittleBoss = true;
        //
        unit.rareWeight = rareWeight;
        unit.initEnemyController(enemyId);
        StartCoroutine(IEShowLittleBossBornAnim(s));
    }
Ejemplo n.º 2
0
    public void addEnemy(string enemyId, int index, int rareWeight, bool isBoss = false)
    {
        Transform s;

        if (isBoss)
        {
            s = Instantiate(bossPrefab) as Transform;
        }
        else
        {
            s = Instantiate(enemyPrefab) as Transform;
        }
        s.localScale = Vector3.zero;
        s.SetParent(enemyParent);
        s.position = getPosByIndex(index, true);
        s.name     = SDConstants.ENEMY_TAG + enemyId + "POS" + index;
        BattleRoleData unit = s.GetComponent <BattleRoleData>();

        unit.posIndex = index + SDConstants.MaxSelfNum;
        //unit.sidePosId = index;
        unit.rareWeight = rareWeight;
        unit.initEnemyController(enemyId);
        StartCoroutine(IEShowEnemyBornAnim(s));
    }