internal void Update(GameTime gameTime) { if (_slideState == SlideState.TransitionOn) { _pos += (_transitionDir * 20); if (_pos == 0) { _slideState = SlideState.Active; } OnActivate?.Invoke(this, null); } else if (_slideState == SlideState.TransitionOff) { _pos += (_transitionDir * 20); if (Math.Abs(_pos) == BOUNDARY) { _slideState = SlideState.Inactive; } OnDeactivate?.Invoke(this, null); } else if (_slideState == SlideState.Active) { foreach (var r in _renderers) { r.Update(gameTime); } } }
public void Activate() { _active = true; if (OnActivate != null) { OnActivate.Invoke(this); } }
private void OnItemChosen(Action item) { Item localItem = (Item)item; localItem.UseItem(); OnActivate.Invoke(item, _id); _itemMenu.SetOpenFlag(false); }
public virtual void Activate() { Debug.Log("QuestTask :: Activate: " + gameObject.name); UpdateTaskText(); onActivate?.Invoke(); active = true; GameManager.instance.AddSubtitle(onActivateSubtitleClip); }
public override void Tick(Phase triggerPhase) { base.Tick(triggerPhase); if (OnActivate != null) { OnActivate.Invoke(); } }
/// <summary> /// Activates the Quantum Console. /// </summary> /// <param name="shouldFocus">If the input field should be automatically focused.</param> public void Activate(bool shouldFocus = true) { Initialize(); IsActive = true; _containerRect.gameObject.SetActive(true); OverrideConsoleInput(string.Empty, shouldFocus); OnActivate?.Invoke(); }
public void Activate() { active = true; foreach (var script in scripts) { script.enabled = true; } OnActivate?.Invoke(this, EventArgs.Empty); }
public void Check() { if (GameManager.Instance.LastCheckpoint != this) { OnActivate.Invoke(); particleSystem.Play(); ProgressionManager.Instance.SetLastActivatedCheckpoint(this); } GameManager.Instance.SetLastCheckpoint(this); animator.SetBool("isCollected", true); }
public void Activate() { if (powerReq > 0 && FindObjectOfType <GameManager>().GetPower() <= 0) { // Not enough power } else { active = true; OnActivate?.Invoke(); } }
void CheckTrigger() { foreach (InputTrigger t in triggers) { if (!t.IsActive) { return; } } OnActivate.Invoke(); }
protected void Enter(ColliderType collider) { bool wasActive = Active; inside.Add(collider); OnEnter.Invoke(collider); if (!wasActive) { OnActivate.Invoke(collider); } }
/// <summary> /// Changes bOpenInventory to true for listening objects like InventoryUI to respond to. /// </summary> public void UseInventory() { if (Input.GetKeyDown(KeyCode.Tab)) { bUseInventory = true; OnActivate?.Invoke(this); Debug.Log("Player opens inventory"); } else { bUseInventory = false; } }
/// <summary> /// Interacts with objects with class InteractBase and triggers event OnActivate /// </summary> public void UseObject() { if (Input.GetKeyDown(KeyCode.E)) { bUse = true; OnActivate?.Invoke(this); //Debug.Log("Player press E"); } else { bUse = false; } }
public void Activate() { //this could just as well be something like a synchronizer. //or subscription to the ServerEventsClient // anything that can be enabled / disabled. lbltimer.Interval = 1000; lbltimer.Tick += Lbltimer_Tick; timer.Interval = 5000; timer.Tick += Timer_Tick; timer.Start(); lbltimer.Start(); OnActivate?.Invoke(this, new EventArgs()); _IsActive = true; }
private void DoActivate() { if (!IsEnabled) { try { OnActivate?.Invoke(this, EventArgs.Empty); IsEnabled = true; } catch (Exception ex) { Logger.Error("Failed to activate component.", ex); } } }
/// <summary> /// CBTProc callback function. /// </summary> /// <param name="nCode">The code that the hook procedure uses to determine how to process the message.</param> /// <param name="wParam">Specifies the handle to the window about to be activated.</param> /// <param name="lParam">Specifies a long pointer to a CBTACTIVATESTRUCT structure containing the handle to the active window and specifies whether the activation is changing because of a mouse click.</param> /// <returns></returns> protected override void Hook2Procedure( IntPtr hWinEventHook, uint eventType, IntPtr hWnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime ) { if (eventType == EVENT_SYSTEM_FOREGROUND) { var process = GetActiveProcess(hWnd); OnActivate?.Invoke(this, new EventArgs <Process>(process)); } }
public bool TryActivate(Player player, List <ComboInput> inputs) { // if received input count is lower, we won't be able to activate the combo if (inputs.Count < RequiredInputs.Count) { return(false); } if (SteamHelper.AmIBanned) { Main.NewText("Your massive amounts of cringe caused " + TBARPlayer.Get(player).PlayerStand.StandName + " to refuse moving even a muscle for you"); Main.NewText("It states that you: " + SteamHelper.BanReason); return(false); } // find diffrence so we only check the last "answer" // e.g: we press A1-A1-Up-Down; combo is just Up-Down // it will skip over A1-A1 and only check the last 2 inputs int dif = Math.Abs(RequiredInputs.Count - inputs.Count); for (int i = 0 + dif; i < inputs.Count; i++) { if (inputs[i] != RequiredInputs[i - dif]) { return(false); } } DrawHelper.CircleDust(player.Center, Vector2.Zero, 6, 8, 8, 1.85f); OnActivate?.Invoke(player); SendPacket(player, ComboName, player.whoAmI); if (!Main.dedServ) { ComboTimeRunner.AchievedCombo = true; } return(true); }
public void Activate(Hashtable parameters) { LastParameters = parameters; OnActivate?.Invoke(this, parameters); IsActive = true; }
protected void OnActivated(object sender, EventArgs e) { OnActivate?.Invoke(sender, e); _IsActive = true; }
public void Activate() { OnActivate?.Invoke(); }
protected void Activate() { Active = true; OnActivate?.Invoke(this); }
private void OnCardChosen(Action action) { OnActivate.Invoke(action, _id); _itemMenu.SetOpenFlag(false); }
protected internal void PerformOnActivate() { OnActivate?.Invoke(); }
public void ForceActivate(Player player) { OnActivate?.Invoke(player); }
public void InvokeCallback() { OnActivate.Invoke(this); }
public void Activate(Action onFinishedCallback) { onFinishedCallback_ = onFinishedCallback; Activate(); OnActivate.Invoke(this); }
private void Activate() { OnActivate?.Invoke(this); }