public void IncreaseBullets() { Bullets++; Spread += 1.0f; OnBulletsChange.Invoke(Bullets); OnSpreadChange.Invoke(Spread); }
private void Start() { OnHealthChange.Invoke(Health); OnBulletsChange.Invoke(Bullets); OnCritChange.Invoke(CritChance); OnAttackSpeedChange.Invoke(AttackSpeed); OnBulletSpeedChange.Invoke(BulletsSpeed); OnDamageChange.Invoke(Damage); OnSpreadChange.Invoke(Spread); }
private void InvokeValueChangeEvent() { if (valueChanged != null) { valueChanged.Invoke(m_value); } }
private void OnValueChange(InputAction.CallbackContext context) { Vector2 value = context.ReadValue <Vector2>(); OnXValueChange.Invoke(value.x); OnYValueChange.Invoke(value.y); }
protected virtual void OnValueChangeEvent(double oldValue_, double newValue_) { if (ValueChangeEvent != null) { ValueChangeEvent.Invoke(oldValue_, newValue_); } }
private void IntEditor_ValueChanged(NumberEditor <int> sender, int value) { if (onValueChanged != null) { onValueChanged.Invoke(value); } }
void setProgress(float pro) { if (autoOneToZero) { pro = pro % 1; } m_value = pro;//记录下 switch (m_uitype) { case UiType.IMAGE: image.fillAmount = pro; break; case UiType.SLIDER: slider.value = pro; break; default: break; } valueChangeEvent.Invoke(pro); if (updateRt) { if (isHorizontal) { updateRt.anchoredPosition = new Vector2(image.rectTransform.rect.size.x * pro, updateRt.anchoredPosition.y); } else { updateRt.anchoredPosition = new Vector2(updateRt.anchoredPosition.x, -image.rectTransform.rect.size.y * pro); } } }
private void Update() { //触发事件 if (movementVector != Vector2.zero) { ValueChangeEvent?.Invoke(movementVector); } }
private void CheckOverlap() { Collider[] results = Physics.OverlapSphere(transform.position, checkDistance, overlapMask, QueryTriggerInteraction.Ignore); // Get bounds of each, find the nearest List <Vector3> bounds = GetColliderBounds(results); float closest = FindClosestPoint(bounds); // What's the percentage of the overlapping object? float percentage = Mathf.InverseLerp(checkDistance / 2.0f, 0.0f, closest); OnValueChange.Invoke(percentage); }
public float this[int y, int x] { get { return(values_[y, x]); } set { values_[y, x] = value; bool isTrue = value > 0; objects_[y, x].SetActive(isTrue); onValueChanged.Invoke(x, y, isTrue); } }
private void Start() { maxStamina.ForceInit(); currentStamina.ForceInit(); valueChange.Invoke(this); }
public void IncreaseDamage() { Damage += 0.5f; OnDamageChange.Invoke(Damage); }
private void SetValue(Vector3 rotation) { Value = CalculateValue(rotation); OnXValueChange.Invoke(Value.x); OnYValueChange.Invoke(Value.y); }
public void IncreaseCritChance() { CritChance += CritCHanceIncrease; OnCritChange.Invoke(CritChance); }
private void OnInputChanged(string text) { Value = text; ValueChanged(this, text); onValueChanged.Invoke(text); }
private void Awake() { killsForMaxSoulEnergy = (int)stageData.GetMaxSoulEnergyKills(); valueChange.Invoke(this); }
private void Start() { valueChange.Invoke(this); }
private void Start() { maxExperiencePoints.ForceInit(); valueChange.Invoke(this); }
public void IncreaseBulletSpeed() { BulletsSpeed += 8.0f; OnBulletSpeedChange.Invoke(BulletsSpeed); }
private void ApplyValue(float value) { SetHandlePosition(value); OnValueChange.Invoke(Value); }
public void IncreaseAttackSpeed() { AttackSpeed += AttackSpeedIncrease; OnAttackSpeedChange.Invoke(AttackSpeed); }
private void Start() { currentHealth.ForceInit(); maxHealth.ForceInit(); valueChange.Invoke(this); }
private void SetValue(float rotation) { Value = Mathf.InverseLerp(minimum, maximum, rotation); OnValueChange.Invoke(Value); }