コード例 #1
0
        internal PlayerHandle(int index)
        {
            this.index = index;
            currentInputConsumer.children.Add(this);

            if (onChange != null)
            {
                onChange.Invoke();
            }
        }
コード例 #2
0
        protected void Changed(string propertyName)
        {
            var diff = new C();
            var val  = Get <dynamic>(propertyName);

            typeof(C).GetProperty(propertyName).SetValue(diff, val);
            ChangeEvent?.Invoke(diff);
        }
コード例 #3
0
        internal PlayerHandle(int index)
        {
            this.index = index;

            treeNode = new InputEventTree
            {
                name         = "Player " + index,
                processInput = ProcessEvent,
                beginFrame   = BeginFrameEvent,
                endFrame     = EndFrameEvent
            };
            currentInputConsumer.children.Add(treeNode);

            if (onChange != null)
            {
                onChange.Invoke();
            }
        }
コード例 #4
0
        /// <summary>
        /// triger the event
        /// </summary>
        /// <param name="s">string to be passed to the event handlers</param>
        public void DoChange(String s)
        {
            // when no handles are added to the event, the event (actually the hiden flag) is set to null
            // so we need to protect
            //
            // this is equivalent with:
            //
            // if (ChangeEvent != null)
            //     ChangeEvent(s);

            ChangeEvent?.Invoke(s);
        }
コード例 #5
0
        public void ElecticDamage(float value)
        {
            Hitpoints = Mathf.Max(0f, Hitpoints - (value - value * (ElecticResistance / 100)));

            ChangeEvent?.Invoke(Hitpoints);

            if (Hitpoints > 0f)
            {
                return;
            }

            DieEvent?.Invoke();
        }
コード例 #6
0
 public override void Deserialize(NetDataReader reader)
 {
     val = new TransformState
     {
         Position = new Vector3(reader.GetFloat(), 0, reader.GetFloat()),
         Angle    = reader.GetFloat()
     };
     if (OnlyTriggerClientEvent && networkObject.IsServer)
     {
         return;
     }
     ChangeEvent?.Invoke(this, val);
 }
コード例 #7
0
        public void PureDamage(float value)
        {
            Hitpoints = Mathf.Max(0f, Hitpoints - value);

            ChangeEvent?.Invoke(Hitpoints);

            if (Hitpoints > 0f)
            {
                return;
            }

            DieEvent?.Invoke();
        }
コード例 #8
0
        public void FireDamage(float value)
        {
            Hitpoints = Mathf.Max(0f, Hitpoints - (value - value * (FireResistance / 100)));
            StartCoroutine(TickDamageRoutine(value));

            ChangeEvent?.Invoke(Hitpoints);

            if (Hitpoints > 0f)
            {
                return;
            }

            DieEvent?.Invoke();
        }
コード例 #9
0
        /// <summary>
        /// Tiggers the change event.
        /// </summary>
        protected virtual void TriggerChangeEvent()
        {
            // Apply the string to the label componenet
            if (this.m_LabelText != null)
            {
                this.m_LabelText.text = this.m_SelectedItem;
            }

            // Invoke the on change event
            if (onChange != null)
            {
                onChange.Invoke(this.selectedOptionIndex, this.m_SelectedItem);
            }
        }
コード例 #10
0
ファイル: FirewallGuard.cs プロジェクト: safino9/priv10
        private void OnRuleChanged(object obj, EventRecordWrittenEventArgs arg)
        {
            if (arg.EventRecord == null)
            {
                return;
            }

            RuleChangedEvent args = ReadFirewallEvent(arg.EventRecord);

            if (args != null)
            {
                ChangeEvent?.Invoke(this, args);
            }
        }
コード例 #11
0
        private void emitChange(List <ChangedValue> changedList)
        {
            var command = new Command.CommandChange();

            command.ChangedCell = new List <Command.CommandChange.ValueChange>();
            foreach (var changed in changedList)
            {
                command.ChangedCell.Add(
                    new Command.CommandChange.ValueChange()
                {
                    ColumnName = m_columnName[changed.Position.Column],
                    RowName    = m_rowName[changed.Position.Row],
                    NewValue   = changed.Value,
                }
                    );
            }
            ChangeEvent?.Invoke(command);
        }
コード例 #12
0
ファイル: AddNewCircle.cs プロジェクト: EAVologzhanin/TreeApp
 private void Add_Click(object sender, EventArgs e)
 {
     try
     {
         price  = double.Parse(richTextBox3.Text);
         info   = richTextBox2.Text;
         chance = double.Parse(richTextBox1.Text);
         AddEvent?.Invoke(this, null);
         ChangeEvent?.Invoke(this, null);
         AddSquare?.Invoke(this, null);
         AddTriangle?.Invoke(this, null);
         Close();
     }
     catch
     {
         MessageBox.Show("Введите корректные данные");
     }
 }
コード例 #13
0
        public void IceDamage(float value)
        {
            Hitpoints = Mathf.Max(0f, Hitpoints - (value - value * (IceResistance / 100)));
            var movement = GetComponentInParent <Movement>();

            if (movement.Speed > 0)
            {
                movement.SetSpeed(movement.Speed - (movement.Speed * 0.1f));
            }

            ChangeEvent?.Invoke(Hitpoints);

            if (Hitpoints > 0f)
            {
                return;
            }

            DieEvent?.Invoke();
        }
コード例 #14
0
        /// <summary>
        /// Tiggers the change event.
        /// </summary>
        protected virtual void TriggerChangeEvent(Toggle toggle)
        {
            Color color = Color.black;

            //find the color... lord this is goin to be fun
            Image[] imgs = toggle.GetComponentsInChildren <Image>();
            foreach (Image img in imgs)
            {
                if (img.name == "Color Image")
                {
                    color = img.color;
                    break;
                }
            }
            // Invoke the on change event
            if (onChange != null)
            {
                onChange.Invoke(toggle.name, color);
            }
        }
コード例 #15
0
ファイル: HeroManager.cs プロジェクト: ma-chu/BattleRoyal
    protected virtual void OnExchange2()
    {
        if (decision == Decision.Attack)
        {
            AttackEvent?.Invoke();
        }

        if ((preCoeffs[1].exchangeResult == ExchangeResult.GetHit) && !m_dead)    // если не помер после первого удара
        {
            GetHitEvent?.Invoke(2);                                               // то принимаем второй
            if (_HP.TakeDamage(/*damage2*/ gotDamage))
            {
                InvokeDeathEvent();
            }
        }

        if (((decision == Decision.ChangeSwordShield) || (decision == Decision.ChangeSwordSword) || (decision == Decision.ChangeTwoHandedSword)) &&
            !m_dead)
        {
            ChangeEvent?.Invoke();
        }
        else
        {
            if (preCoeffs[1].exchangeResult == ExchangeResult.Parry)
            {
                ParryEvent?.Invoke(2);
            }
            if (preCoeffs[1].exchangeResult == ExchangeResult.Block)
            {
                BlockEvent?.Invoke(2);
            }
        }

        if (preCoeffs[1].exchangeResult == ExchangeResult.Evade)
        {
            EvadeEvent?.Invoke(2);
        }
    }
コード例 #16
0
        private void Assign(ControlScheme controlScheme, List <InputDevice> devices)
        {
            m_ControlScheme = controlScheme;

            // Create state for every device.
            var deviceStates = new List <InputState>();

            foreach (var device in devices)
            {
                deviceStates.Add(new InputState(device));
            }
            m_DeviceStates = deviceStates;
            RefreshBindings();

            ResetControlsForCurrentReceivers();

            Reset();

            if (onStatusChange != null)
            {
                onStatusChange.Invoke();
            }
        }
コード例 #17
0
    void Update()
    {
        if (isHeld)
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 1000f, LayerMask.GetMask("ManipulationNodeZone")))
            {
                transform.localPosition = hit.point;

                transform.localPosition = origin +
                                          new Vector3(
                    xAxis ? Mathf.Max(Mathf.Min((transform.localPosition - origin).x, xRatio * xRange.y), xRatio * xRange.x) : 0f,
                    yAxis ? Mathf.Max(Mathf.Min((transform.localPosition - origin).y, yRatio * yRange.y), yRatio * yRange.x) : 0f,
                    zAxis ? Mathf.Max(Mathf.Min((transform.localPosition - origin).z, zRatio * zRange.y), zRatio * zRange.x) : 0f);


                if (xAxis)
                {
                    OnChangeValueX.Invoke(xValue);
                }

                if (yAxis)
                {
                    OnChangeValueY.Invoke(yValue);
                }

                if (zAxis)
                {
                    OnChangeValueZ.Invoke(zValue);
                }

                OnChangeValue.Invoke(this);
            }
        }
    }
コード例 #18
0
 private void OnChangeEvent(string lineName) => ChangeEvent?.Invoke(lineName, this);
コード例 #19
0
 public void InvokeChangeEvent(EntityChangeData.EntityChangeType changeType, BaseDataBlob db)
 {
     ChangeEvent?.Invoke(changeType, db);
 }
コード例 #20
0
 protected virtual void OnChange(int at, int len)
 {
     ChangeEvent?.Invoke(this, at, len);
 }
コード例 #21
0
 public void FireChangeEvent() =>
 ChangeEvent.Invoke();
コード例 #22
0
 private void NotifyValueChanged(DateTime oldValue)
 {
     ChangeEvent?.Invoke(this, ChangeType.Set, oldValue);
 }
コード例 #23
0
 private void ExcecuteChange(Command.CommandChange command)
 {
     ChangeEvent?.Invoke(command);
 }
コード例 #24
0
 private void OnChanged()
 {
     ChangeEvent?.Invoke();
 }
コード例 #25
0
ファイル: Users.cs プロジェクト: Meiendorf/Udon
 public void Changed()
 {
     ChangeEvent.Invoke();
 }
コード例 #26
0
 public void OnEventRaised(object value)
 {
     ObjectResponse.Invoke(value);
 }
コード例 #27
0
 private void DeviceNode_ChangeEvent(DeviceNode diff)
 {
     diff.NodeID = NodeID;
     ChangeEvent?.Invoke(diff);
 }
コード例 #28
0
 private void NodeProperty_ChangeEvent(NodeProperty diff)
 {
     diff.PropertyID = PropertyID;
     ChangeEvent?.Invoke(diff);
 }
コード例 #29
0
 internal void OnChangeEvent(string lineName) => ChangeEvent?.Invoke(lineName, this);
コード例 #30
0
 private void NotifyEnabledChanged()
 {
     ChangeEvent?.Invoke(this, ChangeType.Enabled, m_activeStack.Peek());
 }