private void OnEnable() { MaxHeight.Subscribe(ComputeScore); SparksCollected.Subscribe(ComputeScore); Score.SetValue(0); }
void Update() { if (IsRunning) { _runningTime += Time.deltaTime; TimeValue?.SetValue((int)Mathf.Floor(_runningTime)); } }
private void Compute() { float height = MaxHeightReached.GetValue(); int currentLevel = Mathf.CeilToInt(MAX_DIFFICULTY * height / (EQUILIBRIUM + height)); Difficulty.SetValue(currentLevel); }
private void UpdateValue() { _value?.SetValue(_rigidbody.velocity); _forwardVelocity?.SetValue(Mathf.Abs(_rigidbody.velocity.z)); if (_isRunning && _isRunning.Value) { _runningTime?.SetValue(_runningTime.Value + (int)(Time.deltaTime * 1000f)); } }
public void Invoke() { var pos = m_pos.Value.Vector3Int(); for (var idx = m_idxOffset.Value; idx < IterationOffset.Length; idx++) { var offset = IterationOffset[idx]; m_iteratorIdx.SetValue(idx); m_cornerPos.SetValue(new Vector3(pos.x + offset.x, pos.y + offset.y, pos.z + offset.z)); m_continue.Invoke(); } }
void Update() { if (RCC_SceneManager.Instance.activePlayerVehicle != _currentCarController) { _updating = true; _currentCarController = RCC_SceneManager.Instance.activePlayerVehicle; _currentCarRigidbody = RCC_SceneManager.Instance.activePlayerVehicle.GetComponent <Rigidbody>(); var comPos = RCC_SceneManager.Instance.activePlayerVehicle.COM.localPosition; ComY.SetValue(comPos.y); ComZ.SetValue(comPos.z); MaxSpeed.SetValue((int)RCC_SceneManager.Instance.activePlayerVehicle.maxspeed); CarMass.SetValue((int)_currentCarRigidbody.mass); _updating = false; } }
// Update is called once per frame void Update() { Value.SetValue((int)Slider.value); }
void Start() { TotalCash.SetValue(ES3.Load(SaveKeys.TotalCash, 0)); }