Exemplo n.º 1
0
    public override IPlayer createPlayer(ENUM_Player emPlayer, ENUM_Weapon emWeapon, Vector3 spawnPosition)
    {
        PlayerBuildParam buildParam = new PlayerBuildParam();

        switch (emPlayer)
        {
        case ENUM_Player.PlayerAssault:
            buildParam.character = new PlayerAssault();
            break;

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

        playerBuilder.setBuildParam(buildParam);
        m_characterBuilderSystem.construct(playerBuilder);
        return(buildParam.character as IPlayer);
    }