public void SetArgs() { if (args != null) { //Debug.LogWarning("Executing set args"); VsnSaveSystem.SetVariable("argsCount", args.Length); for (int i = 0; i < args.Length; i++) { if (args[i].GetType() == typeof(VsnNumber)) { VsnSaveSystem.SetVariable("arg" + (i + 1), args[i].GetNumberValue()); Debug.Log("Setting variable arg" + (i + 1) + " to value: " + args[i].GetNumberValue()); } else if (args[i].GetType() == typeof(VsnString)) { VsnSaveSystem.SetVariable("arg" + (i + 1), args[i].GetStringValue()); Debug.Log("Setting variable arg" + (i + 1) + " to value: " + args[i].GetStringValue()); } else { VsnSaveSystem.SetVariable("arg" + (i + 1), args[i].GetReference()); Debug.Log("Setting variable arg" + (i + 1) + " to value: " + args[i].GetReference()); } } } }
public void FinishMinigame() { Time.timeScale = 0; VsnSaveSystem.SetVariable("coins", coins); VsnSaveSystem.SetVariable("current_coins", coins); VsnSaveSystem.SetVariable("minigame_played", 1); VsnController.instance.StartVSNContent("say \"FIM DO MINIGAME!\"\nload_scene \"Main\"", "custom"); }
public override void Execute() { VsnArgument variableName = args[0]; VsnArgument valueToAdd = args[1]; float oldValue = VsnSaveSystem.GetFloatVariable(variableName.GetReference()); float newValue = oldValue + valueToAdd.GetNumberValue(); VsnSaveSystem.SetVariable(variableName.GetReference(), newValue); VsnSaveSystem.Save(0); }
public void OnTextInputConfirm() { if (string.IsNullOrEmpty(textInputField.text)) { // SoundManager.PlayForbiddenSound(); return; } VsnController.instance.state = ExecutionState.PLAYING; if (textInputField.text != "") { VsnSaveSystem.SetVariable("text_input", textInputField.text); VsnSaveSystem.SetVariable("number_input", int.Parse(textInputField.text)); } ShowTextInput(false); }
private void Start() { instance = this; UpdateUI(); VsnAudioManager.instance.PlayMusic("song_intro", "song_loop"); if (VsnSaveSystem.GetIntVariable("minigame_played") == 0) { VsnController.instance.StartVSN("intro"); } else { VsnSaveSystem.SetVariable("minigame_played", 0); VsnController.instance.StartVSN("return_minigame"); } }
public override void Execute() { float fvalue = args[1].GetNumberValue(); string svalue = args[1].GetStringValue(); Debug.Log("SET VAR FLOAT: " + fvalue + ", STRING: " + svalue); if (args[1].GetType() == typeof(VsnString) || (args[1].GetType() == typeof(VsnReference) && args[1].GetStringValue() != "")) { VsnSaveSystem.SetVariable(args[0].GetReference(), args[1].GetStringValue()); return; } else if (args[1].GetType() == typeof(VsnNumber) || (args[1].GetType() == typeof(VsnReference) && args[1].GetReference()[0] == '#')) { VsnSaveSystem.SetVariable(args[0].GetReference(), args[1].GetNumberValue()); return; } Debug.LogWarning(args[0].GetReference() + " var value: " + args[1].GetPrintableValue()); }