// Update is called once per frame void Update() { int _CharId = (int)_MAnimCtrl._Char; if (_CharIdPrev != _CharId) { _CharIndexChanged.Invoke((int)_CharId); } _CharIdPrev = _CharId; }
void UpdatePropValues() { _HP = Mathf.Clamp(_HP, 0, _HPMax); float t = Time.deltaTime * _LerpSpd; _HPF = Mathf.Lerp(_HPF, (float)_HP, t); _HPMF = Mathf.Lerp(_HPMF, (float)_HPMax, t); _HPMaxFChanged.Invoke(_HPMF); }
public void Update() { for (int i = 0; i < 3; i++) { bool bDown = Input.GetMouseButtonDown(i); bool bUp = Input.GetMouseButtonUp(i); bool bMouse = Input.GetMouseButton(i); if (bDown) { _MouseButtonDown.Invoke(i); } if (bUp) { _MouseButtonUp.Invoke(i); } if (bMouse) { _MousePressed.Invoke(i); } } _MouseScroll.Invoke(Input.mouseScrollDelta); }
public void SubmitRatingValue() { float sliderMin = _RatingSlider.minValue; float sliderMax = _RatingSlider.maxValue; float val = _RatingSlider.value; float propVal = (val - sliderMin) / (sliderMax - sliderMin); float freqA = _randOscVals._GrpA.GetFreq(); float freqB = _randOscVals._GrpB.GetFreq(); float propReal = freqA / freqB; if (propReal > 1.0f) { propReal = 1.0f / propReal; } float freqUser = propVal; if (freqA > freqB) { freqUser = propVal * freqA; } else { freqUser = propVal * freqB; } DataRow dr = _DT.NewRow(); dr["Time"] = Time.realtimeSinceStartup; dr["FrequencyA"] = freqA; dr["FrequencyB"] = freqB; dr["Rating_Prop"] = propVal; dr["Rating_Real"] = freqUser; _DT.Rows.Add(dr); //DataTableUtils.PrintDataRow(dr); DataTableUtils.PrintDataTable(_DT); float dif = Mathf.Abs(propVal - propReal) * 100.0f; _Difference.Invoke(dif); if (dif < _BestResult) { _BestResult = dif; } _Results.Add(dif); ComputeAverageResult(); print("Best:" + _BestResult + " Average:" + _AverageResult); _BestResultEvt.Invoke(_BestResult); _AverageResultEvt.Invoke(_AverageResult); _TestCount.Invoke(_DT.Rows.Count); _Submit.Invoke(); }