public override void AfterCutsceneLoad() { Dictionary <string, CutsceneScript> DicScripts; if (Owner == null) { DicScripts = LoadAllScripts(); } else { DicScripts = Owner.DicCutsceneScript; } string[] Content = _Text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries); string PreviousEvent = null; CutsceneActionScript LastActionScript = null; foreach (string Line in Content) { string[] LineContent = Line.Split(new string[1] { ", " }, StringSplitOptions.None); string ScriptName = LineContent[0]; CutsceneScript LineScript = DicScripts[ScriptName].CopyScript(Owner); System.Reflection.PropertyInfo[] ScriptProperties = LineScript.GetType().GetProperties(); int i = 1; foreach (System.Reflection.PropertyInfo Property in ScriptProperties) { if (Property.CanWrite) { string Value = ""; if (i < LineContent.Length) { Value = LineContent[i]; } string[] ArrayLineContent = Value.Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries); if (Property.PropertyType.IsArray) { Property.SetValue(LineScript, Convert.ChangeType(ArrayLineContent, Property.PropertyType, CultureInfo.InvariantCulture)); } else if (Property.PropertyType.IsEnum) { object EnumValue = Enum.Parse(Property.PropertyType, Value); Property.SetValue(LineScript, Convert.ChangeType(EnumValue, Property.PropertyType, CultureInfo.InvariantCulture)); } else { Property.SetValue(LineScript, Convert.ChangeType(Value, Property.PropertyType, CultureInfo.InvariantCulture)); } ++i; } } CutsceneActionScript LineActionScript = LineScript as CutsceneActionScript; if (LineActionScript != null) { int CurrentScriptCount = 0; if (Owner != null) { LineActionScript.ExecuteEvent = Owner.ExecuteEvent; LineActionScript.GetDataContainerByID = Owner.GetDataContainerByID; CurrentScriptCount = Owner.DicActionScript.Count; Owner.AddActionScript(LineActionScript); } if (PreviousEvent == null) { ListTextScriptToTrigger.Add(LineActionScript); } else { int EventIndex = Array.IndexOf(LastActionScript.NameEvents, PreviousEvent); LastActionScript.ArrayEvents[EventIndex].Add(new EventInfo(CurrentScriptCount, 0)); } PreviousEvent = null; if (LineContent.Length > i) { PreviousEvent = LineContent[i]; LastActionScript = LineActionScript; } else { LastActionScript = null; } } else { CutsceneDataContainer LineDataContainer = LineScript as CutsceneDataContainer; if (LineDataContainer != null && Owner != null) { Owner.ListDataContainer.Add(LineDataContainer); } } } }