Browse Source

Added HasVariable() and GetVariableNames() - thanks murnyipl!

master
Christopher 8 years ago
parent
commit
54395b6920
  1. 34
      Assets/Fungus/Scripts/Components/Flowchart.cs
  2. 423
      Assets/Tests/Scripting/Scripting.unity
  3. 11
      ProjectSettings/ProjectSettings.asset
  4. 2
      ProjectSettings/ProjectVersion.txt

34
Assets/Fungus/Scripts/Components/Flowchart.cs

@ -739,6 +739,40 @@ namespace Fungus
Debug.LogWarning("Variable " + key + " not found.");
}
/// <summary>
/// Checks if a given variable exists in the flowchart.
/// </summary>
public virtual bool HasVariable(string key)
{
for (int i = 0; i < variables.Count; i++)
{
var v = variables[i];
if (v != null && v.Key == key)
{
return true;
}
}
return false;
}
/// <summary>
/// Returns the list of variable names in the Flowchart.
/// </summary>
public virtual string[] GetVariableNames()
{
var vList = new string[variables.Count];
for (int i = 0; i < variables.Count; i++)
{
var v = variables[i];
if (v != null)
{
vList[i] = v.Key;
}
}
return vList;
}
/// <summary>
/// Gets a list of all variables with public scope in this Flowchart.
/// </summary>

423
Assets/Tests/Scripting/Scripting.unity

File diff suppressed because it is too large Load Diff

11
ProjectSettings/ProjectSettings.asset

@ -123,6 +123,7 @@ PlayerSettings:
iPhoneTargetOSVersion: 22
tvOSSdkVersion: 0
tvOSTargetOSVersion: 900
tvOSRequireExtendedGameController: 0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
@ -162,6 +163,7 @@ PlayerSettings:
iOSLaunchScreeniPadCustomXibPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
appleDeveloperTeamID:
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
@ -206,12 +208,15 @@ PlayerSettings:
wiiUSystemHeapSize: 128
wiiUTVStartupScreen: {fileID: 0}
wiiUGamePadStartupScreen: {fileID: 0}
wiiUDrcBufferDisabled: 0
wiiUProfilerLibPath:
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
XboxTitleId:
XboxImageXexPath:
XboxSpaPath:
@ -251,7 +256,8 @@ PlayerSettings:
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutResolution: 4
ps4VideoOutInitialWidth: 1920
ps4VideoOutReprojectionRate: 120
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
@ -280,9 +286,12 @@ PlayerSettings:
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
ps4UseResolutionFallback: 0
restrictedAudioUsageRights: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4SocialScreenEnabled: 0
ps4ScriptOptimizationLevel: 3
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:

2
ProjectSettings/ProjectVersion.txt

@ -1,2 +1,2 @@
m_EditorVersion: 5.4.1f1
m_EditorVersion: 5.4.2f1
m_StandardAssetsVersion: 0

Loading…
Cancel
Save