#if PLAYMAKER_1_8_OR_NEWER using System.Collections; using System.Collections.Generic; using UnityEngine; using HutongGames.PlayMaker.Actions; using HutongGames.PlayMaker; using Tooltip = HutongGames.PlayMaker.TooltipAttribute; namespace ES3PlayMaker { [ActionCategory("Easy Save 3")] [Tooltip("Puts each line from a file into an array.")] public class GetLines : SettingsAction { [Tooltip("The relative or absolute path of the file we want to get the lines of.")] public FsmString filePath; [Tooltip("The string array variable we want to load our lines into.")] [ArrayEditor(VariableType.String)] public FsmArray keys; public override void OnReset() { filePath = "file.txt"; keys = null; } public override void Enter() { string file = ES3.LoadRawString(filePath.Value, this.GetSettings()); keys.Values = System.Text.RegularExpressions.Regex.Split(file, "\r\n|\r|\n"); keys.SaveChanges(); } } } #endif