chrisgregan
11 years ago
6 changed files with 42 additions and 26 deletions
@ -0,0 +1,33 @@ |
|||||||
|
using UnityEngine; |
||||||
|
using System; |
||||||
|
using System.Collections; |
||||||
|
|
||||||
|
namespace Fungus.Script |
||||||
|
{ |
||||||
|
[HelpText("Loads a new scene and displays an optional loading image. This is useful " + |
||||||
|
"for splitting a large game across multiple scene files to reduce peak memory " + |
||||||
|
"usage. All previously loaded assets (including textures and audio) will be released." + |
||||||
|
"The scene to be loaded must be added to the scene list in Build Settings.")] |
||||||
|
public class LoadScene : FungusCommand |
||||||
|
{ |
||||||
|
public string sceneName = ""; |
||||||
|
|
||||||
|
public Texture2D loadingImage; |
||||||
|
|
||||||
|
public override void OnEnter() |
||||||
|
{ |
||||||
|
SceneLoader.LoadScene(sceneName, loadingImage); |
||||||
|
} |
||||||
|
|
||||||
|
public override string GetSummary() |
||||||
|
{ |
||||||
|
if (sceneName.Length == 0) |
||||||
|
{ |
||||||
|
return "Error: No scene name selected"; |
||||||
|
} |
||||||
|
|
||||||
|
return sceneName; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 00d03ae0919f04264b018681ed534177 |
||||||
|
MonoImporter: |
||||||
|
serializedVersion: 2 |
||||||
|
defaultReferences: [] |
||||||
|
executionOrder: 0 |
||||||
|
icon: {instanceID: 0} |
||||||
|
userData: |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue