// Update is called once per frame void Update() { if (fpsController.enabled) { EquipSystem equipSystem = GetComponent <EquipSystem>(); if (CrossPlatformInputManager.GetButtonDown("Interact") && itemInView != null) { //Interacting with objects in the world itemInView.GetComponent <InteractableBase>().OnInteract(); } else if (equipSystem && equipSystem.currentEquippedItem) { Pickupable pickupable = equipSystem.currentEquippedItem.GetComponent <Pickupable>(); if (pickupable) { //Using item that the player has equipped if (CrossPlatformInputManager.GetButtonDown("Fire1")) { pickupable.OnUse(); UseItem?.Invoke(pickupable); } else if (CrossPlatformInputManager.GetButtonDown("DropItem")) { equipSystem.DropItem(pickupable.item); } } } } if (CrossPlatformInputManager.GetButtonDown("Cancel")) { CancelAction?.Invoke(); } }
public static void Initialize() { Page = ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList); Page.AddLabel("Title", new Action <GameObject>((obj) => { titleObject = obj; })); Page.AddLabel("Waiting for key...", new Action <GameObject>((obj) => { textObject = obj; })); Page.AddSimpleButton("Clear", new Action(() => { selectedKeys.Clear(); })); Page.AddSimpleButton("Accept", new Action(() => { AcceptAction?.Invoke(selectedKeys); fetchingKeys = false; Page.Hide(); })); Page.AddSimpleButton("Cancel", new Action(() => { CancelAction?.Invoke(); fetchingKeys = false; Page.Hide(); })); }
void OnCancelButtonClicked() { // Helpmode if (HelpDialogController.SetHelpID(SetHelpModeIDAction.HelpModeEntryID.Cancel)) { return; } Dispatcher.Dispatch(CancelAction.From(true)); }
public Pipe(RequestKey Key, PipingOptions Options) { const string Options_WaitingTimeout = nameof(Options) + "." + nameof(Options.WaitingTimeout); this.Key = Key; this.Options = Options; if (Options.WaitingTimeout < TimeSpan.Zero) { throw new ArgumentException(string.Format(NameIsValue1RequiredNameIsValue2Over, Options_WaitingTimeout, Options.WaitingTimeout, nameof(TimeSpan.Zero))); } if (Options.WaitingTimeout is TimeSpan WaitTimeout) { WaitTokenSource = new CancellationTokenSource(WaitTimeout); var Token = WaitTokenSource.Token; CancelAction = WaitTokenSource.Token.Register(() => { ReadyTaskSource.TrySetCanceled(Token); ResponseTaskSource.TrySetCanceled(Token); }); ReadyTaskSource.Task.ContinueWith(t => CancelAction?.Dispose()); } RegisterEvents(); }
public static CancelableFuture <T> Create <T>(Func <OperationContext, T> del, CancelAction action, ProgressTrackerFactory factory) { CancelableFuture <T> cf = new CancelableFuture <T>(del, action, factory); cf.RunInThreadPool(); return(cf); }
public static CancelableFuture <T> Create <T>(Func <OperationContext, T> del, CancelAction action) { return(Create(del, action, ProgressTrackerFactory.Default)); }
IEnumerator AcknowledgeCancel() { yield return(new WaitForSeconds(0)); Dispatcher.Dispatch(CancelAction.From(false)); }
private void Cancel() { StepViewModel.CancelAction?.Invoke(); CancelAction?.Invoke(); }
public void InitInterface() { CutInterface(); m_cancelAction = ScriptableObject.CreateInstance<CancelAction>(); m_cancelAction.Init(this, 0); m_homePortal=ScriptableObject.CreateInstance<HomePortal>(); m_homePortal.Init(this,1); m_stayButton=ScriptableObject.CreateInstance<StayButton>(); m_stayButton.Init(this,2); MineController = ScriptableObject.CreateInstance<MineController>(); MineController.Init(this); }
public void OnTransitionCancel(Transition p0) { CancelAction?.Invoke(); }
internal EmptyCancelableFuture(Action <OperationContext> del, CancelAction action, ProgressTrackerFactory factory) : base(action, factory) { m_futureDel = del; }
/// <summary> /// Cancels this instance. /// </summary> public void Cancel() { Close(); CancelAction?.Invoke(); }
public void Cancel() { MainViewModel.HidePopup(); CancelAction.Invoke(); }
private void Cancel() { CancelAction?.Invoke(); }
public static CancelableFuture CreateNoRun(Action <OperationContext> callback, CancelAction action, ProgressTrackerFactory factory) { return(new EmptyCancelableFuture(callback, action, factory)); }
public static CancelableFuture <T> CreateNoRun <T>(Func <OperationContext, T> del, CancelAction action, ProgressTrackerFactory factory) { return(new CancelableFuture <T>(del, action, factory)); }
/// <summary> /// 取消 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCancel_Click(object sender, RoutedEventArgs e) { CancelAction?.Invoke(); }
protected CancelableFuture(CancelAction action, ProgressTrackerFactory factory) { m_cancelAction = action; m_proxy = new ProgressTrackerProxy(this, factory); m_opContext = new OperationContext(m_proxy); }
public void CancelClicked() { CancelAction?.Invoke(); }