chrisgregan
10 years ago
6 changed files with 71 additions and 1 deletions
@ -0,0 +1,24 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus.Script |
||||
{ |
||||
[CommandName("Load Globals")] |
||||
[HelpText("Loads a set of global variables previously saved using the SaveGlobals command.")] |
||||
public class LoadGlobals : FungusCommand |
||||
{ |
||||
public string saveName = ""; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
GlobalVariables.Load(saveName); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return saveName; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 23c657364a3b24e16bdf5946729a8b7b |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
@ -0,0 +1,24 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus.Script |
||||
{ |
||||
[CommandName("Save Globals")] |
||||
[HelpText("Saves all current global variables to be loaded again later using the LoadGlobals command. This provides a basic save game system.")] |
||||
public class SaveGlobals : FungusCommand |
||||
{ |
||||
public string saveName = ""; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
GlobalVariables.Save(saveName); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return saveName; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 1bef7966140464bd5a3ef4da2ff236b9 |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
Loading…
Reference in new issue