Esempio n. 1
0
        private void OnEnable()
        {
            MaxHeight.Subscribe(ComputeScore);
            SparksCollected.Subscribe(ComputeScore);

            Score.SetValue(0);
        }
Esempio n. 2
0
 void Update()
 {
     if (IsRunning)
     {
         _runningTime += Time.deltaTime;
         TimeValue?.SetValue((int)Mathf.Floor(_runningTime));
     }
 }
Esempio n. 3
0
        private void Compute()
        {
            float height       = MaxHeightReached.GetValue();
            int   currentLevel = Mathf.CeilToInt(MAX_DIFFICULTY * height / (EQUILIBRIUM + height));

            Difficulty.SetValue(currentLevel);
        }
Esempio n. 4
0
        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));
            }
        }
Esempio n. 5
0
        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();
            }
        }
Esempio n. 6
0
    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);
 }
Esempio n. 8
0
 void Start()
 {
     TotalCash.SetValue(ES3.Load(SaveKeys.TotalCash, 0));
 }