public void OnPlaybackWidgetSelection() { int item = CtxMenuButton.current.selectedItem; PlaybackItem pbi = (PlaybackItem)item; Debug.Log("PlaybackWidget: " + pbi.ToString()); }
public void RunPlayback() { try { ShowTabs(Tabs.Log); var openFileDialog1 = new OpenFileDialog { InitialDirectory = "c:\\", Filter = "log files (*.log)|*.log|All files (*.*)|*.*", DefaultExt = "log", FilterIndex = 2, RestoreDirectory = true }; if (openFileDialog1.ShowDialog() == DialogResult.OK) { var pbi = new PlaybackItem() { FileName = openFileDialog1.FileName, MultiThread = false, QueryTab = this }; using (var nc = new NewConnection()) { if (nc.ShowDialog(this) != DialogResult.OK) { return; } var info = nc.ConnectionInfo; info.Connect(); pbi.ConnectionInfo = info; PlaybackManager.StartPlayback(pbi); } logTextbox.Text = "Started Playback...\r\n"; } } catch (Exception ex) { AppendLogTabLine("Error starting playback.\r\n"); AppendLogTabLine(ex.ToString()); } }
public void Init(Detector detector) { _detector = detector; _detector.guards.Add(this); gameObject.tag = "Guard"; _playbackItem = GetComponent <PlaybackItem>(); alert = Instantiate <GameObject>(_detector.alertPrefab, _detector.alertsParent).transform; alertMaterial = alert.GetComponentInChildren <MeshRenderer>().material; alertSound = alert.GetComponentInChildren <AudioSource>(); angleToDirectView = -1; detectionLevel = 0; alertSound.volume = 0; alertSound.pitch = 0.5f; defaultAlertClip = alertSound.clip; caughtCounter = 0; Debug.LogWarning("New Guard Initialized!"); }
public void Save( LogRecord log ) { // create list of log items from the log record List<LogItem> LogItems = log.CreateLogItems(); // iterate and build the playback list float lasttime = 0.0f; Items = new List<PlaybackItem>(); foreach (LogItem item in LogItems ) { InteractLogItem logitem = item as InteractLogItem; // only record the non-scripted actions (player actions) if ( logitem != null && logitem.scripted.ToLower() == "false" ) { PlaybackItem playback = new PlaybackItem(); playback.Type = PlaybackItem.PlaybackType.interact; playback.InteractName = logitem.InteractName; playback.Character = logitem.param; playback.RealTime = logitem.time; playback.Args = logitem.args; // init delay to this one if unitialized if ( lasttime == 0.0f ) lasttime = logitem.time; // set delay to difference between this command and the last playback.Delay = logitem.time - lasttime; lasttime = logitem.time; // add it Items.Add(playback); } // get dialog button items DialogButtonItem dbi = item as DialogButtonItem; if ( dbi != null ) { PlaybackItem dbPlayback = new PlaybackItem(); dbPlayback.Type = PlaybackItem.PlaybackType.button; dbPlayback.Button = dbi.button; dbPlayback.Dialog = dbi.dialog; dbPlayback.RealTime = dbi.time; // init delay to this one if unitialized if ( lasttime == 0.0f ) lasttime = dbi.time; // set delay to difference between this command and the last dbPlayback.Delay = dbi.time - lasttime; lasttime = dbi.time; // add it Items.Add(dbPlayback); } } }
public void NotifyPlayItemChange(PlaybackItem source) { CurrentPlayItem = source; WeakReferenceMessenger.Default.Send("CurrentPlayChanged", nameof(PlaybackListManageService)); }