예제 #1
0
        public void SendAsync(LoadPattern pattern)
        {
            Message message = new Message();

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

            SendAsync(message);
        }
예제 #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);
        }
예제 #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);
                }
            }
        }
예제 #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()) + ";" + " }");
 }
예제 #5
0
        public void LoadPattern(TextAsset serialized)
        {
            LoadPattern message = Serializer.Deserialize <LoadPattern>(new MemoryStream(serialized.bytes));

            Client.Instance.SendAsync(message);
        }