internal PlayerHandle(int index) { this.index = index; currentInputConsumer.children.Add(this); if (onChange != null) { onChange.Invoke(); } }
protected void Changed(string propertyName) { var diff = new C(); var val = Get <dynamic>(propertyName); typeof(C).GetProperty(propertyName).SetValue(diff, val); ChangeEvent?.Invoke(diff); }
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(); } }
/// <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); }
public void ElecticDamage(float value) { Hitpoints = Mathf.Max(0f, Hitpoints - (value - value * (ElecticResistance / 100))); ChangeEvent?.Invoke(Hitpoints); if (Hitpoints > 0f) { return; } DieEvent?.Invoke(); }
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); }
public void PureDamage(float value) { Hitpoints = Mathf.Max(0f, Hitpoints - value); ChangeEvent?.Invoke(Hitpoints); if (Hitpoints > 0f) { return; } DieEvent?.Invoke(); }
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(); }
/// <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); } }
private void OnRuleChanged(object obj, EventRecordWrittenEventArgs arg) { if (arg.EventRecord == null) { return; } RuleChangedEvent args = ReadFirewallEvent(arg.EventRecord); if (args != null) { ChangeEvent?.Invoke(this, args); } }
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); }
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("Введите корректные данные"); } }
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(); }
/// <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); } }
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); } }
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(); } }
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); } } }
private void OnChangeEvent(string lineName) => ChangeEvent?.Invoke(lineName, this);
public void InvokeChangeEvent(EntityChangeData.EntityChangeType changeType, BaseDataBlob db) { ChangeEvent?.Invoke(changeType, db); }
protected virtual void OnChange(int at, int len) { ChangeEvent?.Invoke(this, at, len); }
public void FireChangeEvent() => ChangeEvent.Invoke();
private void NotifyValueChanged(DateTime oldValue) { ChangeEvent?.Invoke(this, ChangeType.Set, oldValue); }
private void ExcecuteChange(Command.CommandChange command) { ChangeEvent?.Invoke(command); }
private void OnChanged() { ChangeEvent?.Invoke(); }
public void Changed() { ChangeEvent.Invoke(); }
public void OnEventRaised(object value) { ObjectResponse.Invoke(value); }
private void DeviceNode_ChangeEvent(DeviceNode diff) { diff.NodeID = NodeID; ChangeEvent?.Invoke(diff); }
private void NodeProperty_ChangeEvent(NodeProperty diff) { diff.PropertyID = PropertyID; ChangeEvent?.Invoke(diff); }
internal void OnChangeEvent(string lineName) => ChangeEvent?.Invoke(lineName, this);
private void NotifyEnabledChanged() { ChangeEvent?.Invoke(this, ChangeType.Enabled, m_activeStack.Peek()); }