Esempio n. 1
0
        private void Listen()
        {
            while (true)
            {
                try
                {
                    if (m_bStop)
                    {
                        Thread.Sleep(Timeout.Infinite);
                    }

                    /// http://blogs.msdn.com/b/bclteam/archive/2006/06/02/618156.aspx
                    if (!m_bManualCPU)
                    {
                        sensor.cpu = (m_pc1 != null) ? m_pc1.NextValue() : sensor.cpu;
                        if (sensor.cpu < 1)
                        {
                            sensor.cpu = 1;
                        }
                    }
                    if (!m_bManualRAM)
                    {
                        sensor.ram = (uint)((m_pc2 != null) ? m_pc2.NextValue() : sensor.ram);
                        //if (sensor.ramTotal == 0)
                        sensor.ramTotal = (uint)((m_pc3 != null) ? m_pc3.NextValue() : sensor.ramTotal);
                    }

                    OnTrigger.Invoke();
                    System.Threading.Thread.Sleep(m_iUpdateRate);
                }
                catch { }
            }
        }
Esempio n. 2
0
 public void Trigger()
 {
     if (triggerDelegate != null)
     {
         triggerDelegate.Invoke();
     }
 }
 private void OnTriggerEnter(Collider other)
 {
     if (OnTrigger != null)
     {
         OnTrigger.Invoke(this, other);
     }
 }
Esempio n. 4
0
 public virtual void OnTriggerEnter2D(Collider2D collider)
 {
     if (onTrigger != null)
     {
         onTrigger.Invoke(collider);
     }
 }
Esempio n. 5
0
 public static void SetActive(bool state)
 {
     if (IsActive != state)
     {
         OnConsoleVisibilityChange.Invoke(state);
     }
     IsActive = state;
 }
Esempio n. 6
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.transform == target)
     {
         spriteRenderer.sprite = sps[2];
         OnTrigger.Invoke();
     }
 }
Esempio n. 7
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        OnTrigger.Invoke();
        FindObjectOfType <AudioCreater>().PlayEquip();
        Rigidbody2D player = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>();

        player.velocity = Speed;
    }
Esempio n. 8
0
    private void OnCollisionStay(Collision collision)
    {
        if (OnTrigger != null && IsTriggerCollision(collision))
        {
            _deltaForceMod = 0.0f;

            OnTrigger.Invoke();
        }
    }
Esempio n. 9
0
 void BroadcastEvent()
 {
     if (!moduleObject.isActiveAndEnabled || !rulepass || OnTrigger == null || timerEvent < eventInterval)
     {
         return;
     }
     timerEvent = 0f;
     //Position: if atSurface is true, then return water level position, otherwise return this.transform.position
     OnTrigger.Invoke(eventAtSurface ? new Vector3(emitPos.x, (transf.position.y + currentWaterPos) - 0.35f, emitPos.z) : transf.position, transf.rotation);
 }
Esempio n. 10
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         PlayEquip();
         OnTrigger.Invoke();
         if (destroy)
         {
             Destroy(gameObject);
         }
     }
 }
Esempio n. 11
0
    public void OnInputTrigger(bool active)
    {
        if ((active && !startActive) || (!active && startActive))
        {
            DoorOpen();
        }
        else
        {
            DoorClose();
        }

        OnTrigger.Invoke(active);
    }
Esempio n. 12
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         FindObjectOfType <AudioCreater>().PlayEquip();
         OnTrigger.Invoke();
         Debug.Log("gg");
         if (destroy)
         {
             Destroy(gameObject);
         }
     }
 }
Esempio n. 13
0
    private void LateUpdate()
    {
        if (timer > 0)
        {
            timer -= Time.deltaTime;
        }
        else if (timer != -1)
        {
            state = !state;
            timer = state ? holdTime : stepTime;

            OnTrigger.Invoke(state);
        }
    }
Esempio n. 14
0
 private void CollectSword(SwordTask sword)
 {
     if (sword == null)
     {
         throw new System.Exception("No sword component in SwordCollector receiver. Layer matrix is incorrect");
     }
     sword.GiveSword(transform);
     foreach (var listener in completionListeners)
     {
         listener.onTaskCompleted();
     }
     OnTrigger.Invoke();
     Destroy(sword.gameObject);
 }
        protected virtual void OnTriggerEnter(Collider other)
        {
            if (OnTrigger != null)
            {
                if (triggerName.Usable())
                {
                    if (triggerName == other.name)
                    {
                        OnTrigger.Invoke();
                    }
                }
                else
                {
                    OnTrigger.Invoke();
                }
            }

            if (OnTriggerObject != null)
            {
                OnTriggerObject(other.gameObject);
            }
        }
Esempio n. 16
0
        public void DoCollisionCheck(bool triggered = false, CollidAble collidable = null)
        {
            if (IsActiv)
            {
                List <CollidAble> collisions;
                List <int>        alreadyExists = new List <int>();
                if (!triggered)
                {
                    grids      = CollisionDetection.ActivCollisionDetection.UpdateGrids(this);
                    collisions = CollisionDetection.ActivCollisionDetection.CheckCollision(this);
                }
                else
                {
                    collisions = new List <CollidAble>();
                    collisions.Add(collidable);
                }

                if (OnCollisionExit != null || OnTriggerExit != null)
                {
                    for (int i = 0; i < previouseCollisions.Length; i++)
                    {
                        if (!collisions.Contains(previouseCollisions[i]))
                        {
                            if (blocking && previouseCollisions[i].blocking)
                            {
                                OnCollisionExit?.Invoke(previouseCollisions[i], new CollisionArgs(previouseCollisions[i]));
                                if (!triggered)
                                {
                                    collisions[i].DoCollisionCheck(true, this);
                                }
                            }
                            else
                            {
                                OnTriggerExit?.Invoke(previouseCollisions[i], new CollisionArgs(previouseCollisions[i]));
                                if (!triggered)
                                {
                                    collisions[i].DoCollisionCheck(true, this);
                                }
                            }
                        }
                        else
                        {
                            alreadyExists.Add(i);
                        }
                    }
                }

                for (int i = 0; i < collisions.Count; i++)
                {
                    if (!alreadyExists.Contains(i))
                    {
                        if (blocking && collisions[i].blocking)
                        {
                            OnCollisionEnter?.Invoke(collisions[i], new CollisionArgs(collisions[i]));
                            if (!triggered)
                            {
                                collisions[i].DoCollisionCheck(true, this);
                            }
                        }
                        else
                        {
                            OnTriggerEnter?.Invoke(collisions[i], new CollisionArgs(collisions[i]));
                            if (!triggered)
                            {
                                collisions[i].DoCollisionCheck(true, this);
                            }
                        }
                    }
                    else
                    {
                        if (blocking && collisions[i].blocking)
                        {
                            OnCollision?.Invoke(collisions[i], new CollisionArgs(collisions[i]));
                            if (!triggered)
                            {
                                collisions[i].DoCollisionCheck(true, this);
                            }
                        }
                        else
                        {
                            OnTrigger?.Invoke(collisions[i], new CollisionArgs(collisions[i]));
                            if (!triggered)
                            {
                                collisions[i].DoCollisionCheck(true, this);
                            }
                        }
                    }
                }
            }
        }
 private void Trigger() => OnTrigger?.Invoke(_animator, default);
Esempio n. 18
0
 public void Trigger()
 {
     OnTrigger?.Invoke(this, new OnTriggerEventArgs(id_));
 }
Esempio n. 19
0
        internal void EvaluateTrigger(RSTriggerId inTriggerId, ExecutionScope inScope)
        {
            if (!m_Entity.IsAlive())
            {
                return;
            }

            if (OnTrigger != null)
            {
                object arg = RSInterop.ToObject(inScope.Argument, inScope);
                OnTrigger.Invoke(inTriggerId, arg);
            }

            RSRuleData[] rules = m_Table?.Rules;
            int          ruleCount;

            if (rules == null || (ruleCount = rules.Length) <= 0)
            {
                return;
            }

            using (PooledSet <string> triggeredGroups = PooledSet <string> .Alloc())
            {
                for (int i = 0; i < ruleCount; ++i)
                {
                    RSRuleData rule = rules[i];
                    if (rule.TriggerId != inTriggerId)
                    {
                        continue;
                    }

                    if (m_States[i].HasFlag(RuleState.Disabled))
                    {
                        continue;
                    }

                    if (rule.DontInterrupt && m_Routines[i])
                    {
                        continue;
                    }

                    if (!inScope.EvaluateConditions(rule.Conditions, rule.ConditionSubset))
                    {
                        continue;
                    }

                    if (!string.IsNullOrEmpty(rule.RoutineGroup))
                    {
                        if (!triggeredGroups.Add(rule.RoutineGroup))
                        {
                            continue;
                        }

                        StopRuleGroup(rule.RoutineGroup);
                    }

                    if (rule.OnlyOnce)
                    {
                        m_States[i] |= RuleState.Disabled;
                    }

                    if (rule.Actions != null)
                    {
                        ExecutionScope scope = inScope;
                        scope.m_Environment.CloneScopeIfNecessary(scope, rule.Flags, out scope);

                        m_Routines[i].Replace(m_Entity.ProxyObject, scope.PerformActions(rule.Actions))
                        .ExecuteWhileDisabled().SetPhase(m_Entity.ExecutionPhase)
                        .TryManuallyUpdate(0);
                    }
                }
            }
        }
Esempio n. 20
0
 protected override void Replay(TimingEvent raceEvent)
 {
     OnTrigger?.Invoke(this, new TimingTriggeredEventArgs(raceEvent.Microseconds, "SimulatedTimer", raceEvent.GateId, raceEvent.Time));
 }
Esempio n. 21
0
 public void Fire() => OnTrigger?.Invoke();
Esempio n. 22
0
 public void OnButtonTrigger(bool active)
 {
     OnTrigger.Invoke(active);
 }
Esempio n. 23
0
 private void OnTriggerEnter(Collider other)
 {
     OnTrigger?.Invoke(other);
 }
Esempio n. 24
0
 public void TriggerCommand(User user, Channel channel, string arguments, Message message)
 {
     OnTrigger?.Invoke(user, channel, arguments, message);
 }
Esempio n. 25
0
 public void Activate()
 {
     OnTrigger?.Invoke();
 }
 private void TriggerFloat(float value) => OnTrigger?.Invoke(_animator, new AnimationEventArgument(value));
Esempio n. 27
0
 public void TriggerCommand(string arguments)
 {
     OnTrigger?.Invoke(arguments);
 }
 private void TriggerString(string value) => OnTrigger?.Invoke(_animator, new AnimationEventArgument(value));
Esempio n. 29
0
 public void InvokeTrigger(ICollider other)
 {
     OnTrigger?.Invoke(other);
 }
 private void TriggerObject(Object value) => OnTrigger?.Invoke(_animator, new AnimationEventArgument(value));