Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
 public void Activate()
 {
     _active = true;
     if (OnActivate != null)
     {
         OnActivate.Invoke(this);
     }
 }
Ejemplo n.º 3
0
    private void OnItemChosen(Action item)
    {
        Item localItem = (Item)item;

        localItem.UseItem();
        OnActivate.Invoke(item, _id);
        _itemMenu.SetOpenFlag(false);
    }
Ejemplo n.º 4
0
 public virtual void Activate()
 {
     Debug.Log("QuestTask :: Activate: " + gameObject.name);
     UpdateTaskText();
     onActivate?.Invoke();
     active = true;
     GameManager.instance.AddSubtitle(onActivateSubtitleClip);
 }
Ejemplo n.º 5
0
 public override void Tick(Phase triggerPhase)
 {
     base.Tick(triggerPhase);
     if (OnActivate != null)
     {
         OnActivate.Invoke();
     }
 }
Ejemplo n.º 6
0
        /// <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();
        }
Ejemplo n.º 7
0
 public void Activate()
 {
     active = true;
     foreach (var script in scripts)
     {
         script.enabled = true;
     }
     OnActivate?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 8
0
 public void Check()
 {
     if (GameManager.Instance.LastCheckpoint != this)
     {
         OnActivate.Invoke();
         particleSystem.Play();
         ProgressionManager.Instance.SetLastActivatedCheckpoint(this);
     }
     GameManager.Instance.SetLastCheckpoint(this);
     animator.SetBool("isCollected", true);
 }
Ejemplo n.º 9
0
 public void Activate()
 {
     if (powerReq > 0 && FindObjectOfType <GameManager>().GetPower() <= 0)
     {
         // Not enough power
     }
     else
     {
         active = true;
         OnActivate?.Invoke();
     }
 }
Ejemplo n.º 10
0
    void CheckTrigger()
    {
        foreach (InputTrigger t in triggers)
        {
            if (!t.IsActive)
            {
                return;
            }
        }

        OnActivate.Invoke();
    }
Ejemplo n.º 11
0
    protected void Enter(ColliderType collider)
    {
        bool wasActive = Active;

        inside.Add(collider);
        OnEnter.Invoke(collider);

        if (!wasActive)
        {
            OnActivate.Invoke(collider);
        }
    }
Ejemplo n.º 12
0
 /// <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;
     }
 }
Ejemplo n.º 13
0
 /// <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;
     }
 }
Ejemplo n.º 14
0
 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);
                }
            }
        }
Ejemplo n.º 16
0
 /// <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));
     }
 }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
 public void Activate(Hashtable parameters)
 {
     LastParameters = parameters;
     OnActivate?.Invoke(this, parameters);
     IsActive = true;
 }
Ejemplo n.º 19
0
 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);
 }
Ejemplo n.º 22
0
 private void OnCardChosen(Action action)
 {
     OnActivate.Invoke(action, _id);
     _itemMenu.SetOpenFlag(false);
 }
Ejemplo n.º 23
0
 protected internal void PerformOnActivate()
 {
     OnActivate?.Invoke();
 }
Ejemplo n.º 24
0
 public void ForceActivate(Player player)
 {
     OnActivate?.Invoke(player);
 }
Ejemplo n.º 25
0
 public void InvokeCallback()
 {
     OnActivate.Invoke(this);
 }
Ejemplo n.º 26
0
 public void Activate(Action onFinishedCallback)
 {
     onFinishedCallback_ = onFinishedCallback;
     Activate();
     OnActivate.Invoke(this);
 }
Ejemplo n.º 27
0
 private void Activate()
 {
     OnActivate?.Invoke(this);
 }