我的下一个项目将使用Unity 5.6.这将是一款游戏,它将利用AssetBundle进行远程场景加载.之后将逐步添加新场景.因此,我希望我不会使用太糟糕的结构,需要在项目的后期阶段进行大量更改.Unity项目是否有标准/推荐的目录结构?
如果我没有正确使用 axios,请指导我。这段简单的代码可以直接运行:
const axios = require('axios')
axios.post('https://exp.host/--/api/v2/push/send', {"to":["ExponentPushToken[xxxxxxx]"],"title":"test title","body":"test body."})
.then(responseExpo => {
console.log("expo replied normally: " + JSON.stringify(responseExpo));
})
.catch(error => {
console.log("expo replied with error: " + JSON.stringify(error,null,4));
});
Run Code Online (Sandbox Code Playgroud)
结果是:
Promise { <pending> }
expo replied with error: {}
Run Code Online (Sandbox Code Playgroud)
"axios": "^0.19.2"
我尝试使用 api 工具发布并看到带有正常 200 状态代码的响应:
{
"data":[
{
"status": "error",
"message": "\"ExponentPushToken[xxxxxxx]\" is not a registered push notification recipient",
"details":{
"error": "DeviceNotRegistered"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
(您可能会忽略此 json 中的“错误”:“DeviceNotRegistered”,因为这是预期的,因为我在调用 api 时输入了无效的 xxxxx 输入值。即使输入有效的输入值,结果仍然返回到带有空错误的 catch 块)
我期待它返回到 then …