Exemplo n.º 1
0
    public static Actor Load(IArchiveDirectory dataDir, Device device, ShaderCache shaderCache, ControllerManager controllerManager, FigureLoader figureLoader)
    {
        var mainFigure = figureLoader.Load(InitialSettings.Main, null);

        var actorModel = ActorModel.Load(mainFigure.Definition, InitialSettings.Animation);

        var hairFigure = InitialSettings.Hair != null?figureLoader.Load(InitialSettings.Hair, mainFigure.Definition) : null;

        var behavior = ActorBehavior.Load(controllerManager, mainFigure.Definition.Directory, actorModel);

        var outfits = Outfit.LoadList(dataDir);

        var actor           = new Actor(device, outfits, actorModel, figureLoader, mainFigure, hairFigure, behavior);
        var clothingFigures = InitialSettings.Clothing
                              .Select(clothingFigureName => figureLoader.Load(clothingFigureName, mainFigure.Definition))
                              .ToArray();

        actor.SetClothingFigures(clothingFigures);

        return(actor);
    }