mirror of
https://github.com/Buriburizaem0n/live2d.git
synced 2026-02-04 11:30:02 +00:00
模型可以白夜切换了!
This commit is contained in:
@@ -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`)
|
||||||
|
|||||||
Reference in New Issue
Block a user