public virtual void End() { if (onTimerEnd != null) { onTimerEnd(); } onRun = null; onTimerEnd = null; }
public void Run(int games) { OnRun?.Invoke(this, env); while (count < games) { EpStart(); Loop(); EpEnd(); } }
// Start is called before the first frame update void Start() { pLook = GetComponentInChildren <PlayerLook>(); pMove = GetComponent <PlayerMove>(); onRunScript = GetComponent <OnRun>(); pLook.enabled = false; pMove.enabled = false; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; //hides mouse cursor during main build }
public void Run(GimmickValue value, DateTime current) { if (value.TimeStamp <= lastTriggeredAt) { return; } lastTriggeredAt = value.TimeStamp; if ((current - value.TimeStamp).TotalSeconds > Constants.Gimmick.TriggerExpireSeconds) { return; } OnRun?.Invoke(this); }
/// <summary> /// The main process thread. /// Rises <see cref="OnRun"/> event every <see cref="Tick"/> time elapsed /// </summary> public void Run() { // Rise onbefore event OnBeforeRun?.Invoke(this); // Get the tick period in seconds Tick = IoC.Application.TaskRunnerTick; // Starts the new thread IoC.Task.Run(() => { // Initialize the control variable var LastRun = DateTime.Now; // Run as long as the control flag is true while (IsRunning) { // Ticks every previus defined second if (DateTime.Now - LastRun >= TimeSpan.FromSeconds(Tick)) { // Saves the time this run happens LastRun = DateTime.Now; // The time since last iteration var IntervalTime = DateTime.Now - LastRun; // Diagnostics tools to reveal the timestamp in code var Watch = new Stopwatch(); Watch.Start(); // Increment time elapsed only with fullplay if(Writings) ElapsedTime += IntervalTime; // Run the principal event OnRun?.Invoke(this); // Evaluate finish conditions only if we do not wanted to force stop // Kill this thread if nobody is using if (IsRunning) IsRunning = IsReadings() || Writings; // Stop watch time Watch.Stop(); // Log IoC.Logger.Log($"Elapsed Time {ElapsedTime.ToString()}, and time in operations {Watch.ElapsedMilliseconds.ToString()}", LogLevel.Debug); } } }); }
internal bool Run(params object[] args) { try { //ass?.EntryPoint?.Invoke(null,new object[1] { new string[0] } ); //Assembly?.EntryPoint?.Invoke(null, new object[1] { args }); //Assembly?.EntryPoint?.Invoke(null, args); OnRun?.Invoke(args); return(true); } catch (Exception ex) { BooScriptingPlugin.Instance.LogPrint(ex.ToString(), TraceLevel.Error); return(false); } }
protected override IEnumerable <Codeunit> CreateItems() { var codeunit = new Codeunit(ID, Name); SetObjectProperties(codeunit); #if !NAV2016 codeunit.Properties.CFRONTMayUsePermissions = NullableBooleanFromSwitch(nameof(CFrontMayUsePermissions)); #endif #if NAV2016 codeunit.Properties.EventSubscriberInstance = EventSubscriberInstance; #endif codeunit.Properties.Permissions.Set(Permissions); codeunit.Properties.SingleInstance = NullableBooleanFromSwitch(nameof(SingleInstance)); codeunit.Properties.Subtype = SubType; codeunit.Properties.TableNo = TableNo; codeunit.Properties.TestIsolation = TestIsolation; #if NAV2017 codeunit.Properties.TestPermissions = TestPermissions; #endif if (OnRun != null) { var subObjects = OnRun.Invoke().Select(o => o.BaseObject); codeunit.Properties.OnRun.CodeLines.AddRange(subObjects.OfType <string>()); codeunit.Properties.OnRun.Variables.AddRange(subObjects.OfType <Variable>()); } if (SubObjects != null) { var subObjects = SubObjects.Invoke().Select(o => o.BaseObject); codeunit.Code.Documentation.CodeLines.AddRange(subObjects.OfType <string>()); codeunit.Code.Functions.AddRange(subObjects.OfType <Function>()); codeunit.Code.Variables.AddRange(subObjects.OfType <Variable>()); codeunit.Code.Events.AddRange(subObjects.OfType <Event>()); } yield return(codeunit); }
private void Test(int op, OnRun start, OnRun end, OnRun action, OnRun ack) { bool noRead = true; while (!needStop) { if (noRead && start(op)) { // 清空 action(op); ack(op); noRead = false; } if (!noRead && !end(op)) { noRead = true; } //Thread.Sleep(10); } }
public void Run(GimmickValue value, DateTime current) { OnRun?.Invoke(new SetJumpHeightRatePlayerEffect(Mathf.Max(value.FloatValue, 0f))); }
public virtual bool Run() { OnRun?.Invoke(null); return(true); }
public virtual void Run() => OnRun?.Invoke();
private void RunToolStripMenuItem_Click(object sender, EventArgs e) { runToolStripMenuItem.Enabled = false; pauseToolStripMenuItem.Enabled = true; OnRun?.Invoke(sender, e); }
// Update is called once per frame void Update() { //Mouse Input if (Input.GetKey(KeyCode.Mouse0)) { if (OnMouseLeft != null) { OnMouseLeft(CastRayFromCamera()); } PressCount++; } if (Input.GetKeyDown(KeyCode.Mouse0)) { if (OnMouseLeftDown != null) { OnMouseLeftDown(CastRayFromCamera()); } PressCount++; } if (Input.GetKeyUp(KeyCode.Mouse0)) { if (OnMouseLeftUp != null) { OnMouseLeftUp(CastRayFromCamera()); } PressCount++; } //Axis Inputs //Horizontal Axis if (HorizontalAxis != null) { float HorAx = Input.GetAxis(options.s_Horizontal); if (HorAx > options.AxisDeadzone) { HorizontalAxis(HorAx); MovementCount++; } else { HorizontalAxis(0f); } } if (VerticalAxis != null) { //Vertical Axis float VerAx = Input.GetAxis(options.s_Vertical); if (VerAx > options.AxisDeadzone) { VerticalAxis(VerAx); MovementCount++; } else { VerticalAxis(0f); } } //Movement Input if (Input.GetKey(options.forward)) { if (OnForward != null) { OnForward.Invoke(); } if (VerticalAxis != null) { VerticalAxis(1); } PressCount++; MovementCount++; } if (Input.GetKey(options.backward)) { if (OnBackward != null) { OnBackward.Invoke(); } if (VerticalAxis != null) { VerticalAxis(-1); } PressCount++; MovementCount++; } if (Input.GetKey(options.straferight)) { if (OnStraferight != null) { OnStraferight.Invoke(); } if (HorizontalAxis != null) { HorizontalAxis(1); } PressCount++; MovementCount++; } if (Input.GetKey(options.strafeleft)) { if (OnStrafeleft != null) { OnStrafeleft.Invoke(); } if (HorizontalAxis != null) { HorizontalAxis(-1); } PressCount++; MovementCount++; } if (Input.GetKey(options.jump)) { OnJump.NullCheckInvoke(); PressCount++; } if (Input.GetKeyDown(options.jump)) { OnJumpDown.NullCheckInvoke(); PressCount++; } if (Input.GetKeyUp(options.jump)) { OnJumpUp.NullCheckInvoke(); } if (Input.GetKey(options.run)) { OnRun.NullCheckInvoke(); PressCount++; } if (Input.GetKeyDown(options.run)) { OnRunDown.NullCheckInvoke(); PressCount++; } if (Input.GetKeyUp(options.run)) { OnRunUp.NullCheckInvoke(); } if (OnMovement != null) { if (MovementCount > 0) { OnMovement(true); } else { OnMovement(false); } } if (PressCount > 0) { OnAnyKey.NullCheckInvoke(); PressCount = 0; } }
protected void OnBtnRunClicked(object sender, EventArgs e) { OnRun?.Invoke(this); }
private void Run() { Debug.Log($"Pressed Run"); OnRun?.Raise(_flag); }