private void RefreshTotal() { Value = 0; if (inPoints.Count > 0 && inPoints[0].HasConnected) { Value = DigitConvert.CastTo(inPoints[0].Value, ValueType); } else { Value = DigitConvert.CastTo(inValues[0], ValueType); } for (int i = 1; i < inPoints.Count; i++) { var point = inPoints[i]; if (point.HasConnected) { Value = DigitConvert.Multi(Value, point.Value, ValueType); } else { Value = DigitConvert.Multi(Value, inValues[i], ValueType); } } }
private void RefreshTotal() { Value = 0; if (inPoints.Count > 0 && inPoints[0].HasConnected) { Value = DigitConvert.CastTo(inPoints[0].Value, ValueType); } else { Value = DigitConvert.CastTo(inValues[0], ValueType); } for (int i = 1; i < inPoints.Count; i++) { var point = inPoints[i]; if (point.HasConnected) { if (point.Value.CastToFloat() == 0) { Debug.LogError("Divide number must be not equal to zero."); continue; } Value = DigitConvert.Divide(Value, point.Value, ValueType); } else { if (inValues[i].CastToFloat() == 0) { inValues[i] = 1f; } Value = DigitConvert.Divide(Value, inValues[i], ValueType); } } }
public override void OnDrawDetail() { base.OnDrawDetail(); Row(inPoint, ref v); GUI.enabled = false; EditorGUILayout.BeginHorizontal(GUILayout.Width(200)); EditorGUILayout.LabelField("normalized:", GUILayout.Width(50)); object nor = DigitConvert.Normalize(v, valueType); RowField(valueType, ref nor); normalized = nor; EditorGUILayout.EndHorizontal(); GUI.enabled = true; }
private void RefreshTotal() { Value = 0; for (int i = 0; i < inPoints.Count; i++) { var point = inPoints[i]; if (point.HasConnected) { Value = DigitConvert.Add(Value, point.Value, ValueType); } else { Value = DigitConvert.Add(Value, inValues[i], ValueType); } } }