Skip to content

有没有将项目集成到自己的WPF程序中的demo呢 #382

Discussion options

You must be logged in to vote

没有, 不过这里提供部分虚拟主播模拟器写的加载桌宠的代码

读取配置

case "pet":
    //宠物模型
    Content += "宠物形象\n";
    foreach (FileInfo fi in di.EnumerateFiles("*.lps"))
    {
        LpsDocument lps = new LpsDocument(File.ReadAllText(fi.FullName));
        if (lps.First().Name.ToLower() == "pet")
        {
            var name = lps.First().Info;
            var p = core.CorePets.FirstOrDefault(x => x.Name == name);
            if (p == null)
                core.CorePets.Add(new PetLoader(lps, di));
            else
            {
                p.path.Add(di.FullName + "\\" + lps.First()["path"].Info);
                p.Config.Set(lps);
            }
        }
    }
    break;

加载桌宠

//加载桌宠
PetCore = new VPet_Simulator.C…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ChangSheng3407
Comment options

Answer selected by LorisYounger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #381 on May 20, 2024 08:04.