Polish
This commit is contained in:
parent
436dd245aa
commit
39e6386c64
31 changed files with 4520 additions and 490 deletions
26
Assets/Scripts/Loader.cs
Normal file
26
Assets/Scripts/Loader.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Loader : MonoBehaviour {
|
||||
static int? GetArg(string name) {
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
for (int i = 0; i < args.Length; i++) {
|
||||
if (args[i] == name && args.Length > i + 1) {
|
||||
return int.Parse(args[i + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
int? arg = GetArg("scene");
|
||||
if (arg.HasValue) {
|
||||
SceneManager.LoadScene(arg.Value);
|
||||
} else {
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue