Esempio n. 1
0
    public override IEnemy createEnemy(ENUM_Enemy emEnemy, ENUM_Weapon emWeapon, Vector3 spawnPosition)
    {
        //建造参数
        EnemyBuildParam buildParam = new EnemyBuildParam();

        switch (emEnemy)
        {
        case ENUM_Enemy.Zombie:
            buildParam.character = new EnemyZombie();
            break;

        default:
            Debug.Log("不存在该Enemy类型");
            return(null);
        }
        buildParam.weapon        = emWeapon;
        buildParam.spawnPosition = spawnPosition;

        EnemyBuilder enemyBuilder = new EnemyBuilder();

        enemyBuilder.setBuildParam(buildParam);
        m_characterBuilderSystem.construct(enemyBuilder);

        return(buildParam.character as IEnemy);
    }