我已成功设法使用 VBS 打开cmd以将数据写入数据库并按Enter两次键。
这是我的代码:
Set wshshell = wscript.CreateObject("WScript.Shell")
Wshshell.run "cmd"
wscript.sleep 100
wshshell.sendkeys "firebase-import --service_account C:\Users --database_url https://firebaseio.com --json C:\Users\Zed\testing.json"
wscript.sleep 100
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{ENTER}"
Run Code Online (Sandbox Code Playgroud)
这是控制台输出:
firebase-import --service_account C:\Users\Zed\private-firebase-adminsdk-private --path /Jobs/Test --database_url https://private.firebaseio.com --json C:\Users\Zed\testing.json
All data at https://private.firebaseio.com/Jobs/Test will be overwritten.
Press <enter> to proceed, Ctrl-C to abort.
Reading C:\Users\Zed\testing.json... (may take a minute)
Preparing JSON for import... (may take a minute)
Importing [==================================================] 100% (1/1)
Import completed.
Run Code Online (Sandbox Code Playgroud)
我还设法使用 VBS 播放声音。这是代码:
Dim oPlayer
Set …Run Code Online (Sandbox Code Playgroud) 导入项目后,Unity 中不断出现此错误。
这是代码:
public static void CameraFadeSwap(Texture2D texture){
if(cameraFade){
cameraFade.GetComponent<Image>().texture=texture;
}
}
Run Code Online (Sandbox Code Playgroud)
错误是:
Assets\Scripts\Utils\iTween.cs(6016,37): error CS1061: 'Image' does not contain a definition for 'texture' and no accessible extension method 'texture' accepting a first argument of type 'Image' could be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
如何解决?