模型可以白夜切换了!

This commit is contained in:
丑小鸦
2023-07-28 12:30:02 +08:00
committed by GitHub
parent 3b528a796f
commit 0c64c67f15

View File

@@ -190,8 +190,13 @@ function loadWidget() {
modelTexturesId = localStorage.getItem("modelTexturesId"); modelTexturesId = localStorage.getItem("modelTexturesId");
if (modelId === null) { if (modelId === null) {
// 首次访问加载 指定模型 的 指定材质 // 首次访问加载 指定模型 的 指定材质
modelId = 0; // 模型 ID const now = new Date();
modelTexturesId = 0; // 材质 ID if(now.getHours()>=22 || now.getHours()<7){
modelId = 1; // 夜间模型ID
}else{
modelId = 0; // 白天模型ID
}
modelTexturesId = 0; // 材质ID
} }
loadModel(modelId, modelTexturesId); loadModel(modelId, modelTexturesId);
fetch(`${live2d_path}waifu-tips.json`) fetch(`${live2d_path}waifu-tips.json`)