public void SendAsync(LoadPattern pattern) { Message message = new Message(); message.Type = Message.MessageType.LoadPattern; message.LoadPattern = pattern; SendAsync(message); }
public LoadPattern Build() { var pattern = new LoadPattern(); pattern.Identifier = identifier; var tracks = new List <Track>(); foreach (var builder in trackBuilders) { tracks.Add(builder.Build()); } pattern.Tracks = tracks.ToArray(); return(pattern); }
private void Export() { var path = EditorUtility.OpenFolderPanel("Destination folder", ProjectRootPath(), ""); if (path == "") { return; } foreach (var pattern in patterns.GetActivePatterns()) { LoadPattern message = Serialize(pattern); using (var outputStream = File.Create(Path.Combine(path, pattern.name + ".bytes"))) { Serializer.Serialize(outputStream, message); } } }
public override string ToString() { return("{ Message:" + " Type = " + (Type == null ? "null" : Type.ToString()) + ";" + " Vibration = " + (Vibration == null ? "null" : Vibration.ToString()) + ";" + " MuscleStimulation = " + (MuscleStimulation == null ? "null" : MuscleStimulation.ToString()) + ";" + " LoadPattern = " + (LoadPattern == null ? "null" : LoadPattern.ToString()) + ";" + " PlayPattern = " + (PlayPattern == null ? "null" : PlayPattern.ToString()) + ";" + " }"); }
public void LoadPattern(TextAsset serialized) { LoadPattern message = Serializer.Deserialize <LoadPattern>(new MemoryStream(serialized.bytes)); Client.Instance.SendAsync(message); }