Ejemplo n.º 1
0
        public void SendAsync(LoadPattern pattern)
        {
            Message message = new Message();

            message.Type        = Message.MessageType.LoadPattern;
            message.LoadPattern = pattern;

            SendAsync(message);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }
Ejemplo n.º 4
0
 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()) + ";" + " }");
 }
Ejemplo n.º 5
0
        public void LoadPattern(TextAsset serialized)
        {
            LoadPattern message = Serializer.Deserialize <LoadPattern>(new MemoryStream(serialized.bytes));

            Client.Instance.SendAsync(message);
        }