An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using UnityEngine;
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
namespace Fungus.Script
|
|
|
|
{
|
|
|
|
[CommandName("Load Scene")]
|
|
|
|
[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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|