public override void NodeGUI () { GUILayout.BeginHorizontal (); GUILayout.BeginVertical (); if (Inputs [0].connection != null) GUILayout.Label (Inputs [0].name); else Input1Val = RTEditorGUI.FloatField (GUIContent.none, Input1Val); InputKnob (0); // -- if (Inputs [1].connection != null) GUILayout.Label (Inputs [1].name); else Input2Val = RTEditorGUI.FloatField (GUIContent.none, Input2Val); InputKnob (1); GUILayout.EndVertical (); GUILayout.BeginVertical (); Outputs [0].DisplayLayout (); GUILayout.EndVertical (); GUILayout.EndHorizontal (); #if UNITY_EDITOR type = (CalcType)UnityEditor.EditorGUILayout.EnumPopup (new GUIContent ("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type); #else GUILayout.Label (new GUIContent ("Calculation Type: " + type.ToString (), "The type of calculation performed on Input 1 and Input 2")); #endif if (GUI.changed) NodeEditor.RecalculateFrom (this); }
protected internal override void NodeGUI() { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); GUILayout.Label("Val1:" + (float)m_Value1 + " Val2:" + (float)m_Value2); GUILayout.EndVertical(); GUILayout.BeginVertical(); if (Outputs[0] != null) { Outputs [0].DisplayLayout(); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); #if UNITY_EDITOR type = (CalcType)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type); #else GUILayout.Label(new GUIContent("Calculation Type: " + type.ToString(), "The type of calculation performed on Input 1 and Input 2")); #endif if (GUI.changed) { NodeEditor.RecalculateFrom(this); } }
public override void DrawNodePropertyEditor() { #if UNITY_EDITOR type = (CalcType)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type); #else GUILayout.Label(new GUIContent("Calculation Type: " + type.ToString(), "The type of calculation performed on Input 1 and Input 2")); #endif m_Value1.SliderLabel(this, "Value1"); m_Value2.SliderLabel(this, "Value2"); }
/// <summary> /// Starts full calculation proccess. /// </summary> /// <param name="message">String to be printed through the UI.</param> /// <param name="warning">Warning Enum to display to the user.</param> /// <param name="passCount">The desired number of completed paystubs.</param> public static Tuple <List <Paystub>, Tuple <decimal, decimal, decimal>, Tuple <decimal, decimal> > BeginCalc(Message message, WarningMessage warning, List <Paystub> paystubs, decimal accuracy, int passCount = 1) { int completePaystubs = 0; decimal averagePercentage = 0; decimal percentAccuracy = 0; decimal outputRatio = 0; bool paystubRatio = true; bool accuracyOutput = true; Decision = CalculationDecision(paystubs); // Maybe add a name to the paystub collection?? message(Decision.ToString()); Tuple <decimal, int> calcPercentageOutput = CalculatePercentage(paystubs); averagePercentage = calcPercentageOutput.Item1; completePaystubs = calcPercentageOutput.Item2; SetPercentage(paystubs, averagePercentage); Tuple <bool, decimal> checkCompleteOutput = CheckCompletedPaystubRatio(paystubs, passCount, completePaystubs); paystubRatio = checkCompleteOutput.Item1; outputRatio = checkCompleteOutput.Item2; if (Decision == CalcType.CalcGross) { Paystub.GrossFromPercentageList(paystubs); } else if (Decision == CalcType.CalcNet) { Paystub.NetFromPercentageList(paystubs); } Tuple <bool, decimal> checkPercentOutput = CheckPercentageAccuracy(paystubs, accuracy); accuracyOutput = checkPercentOutput.Item1; percentAccuracy = checkPercentOutput.Item2; warning(CheckWarning(paystubRatio, accuracyOutput)); Tuple <decimal, decimal> calcAccuracy = Tuple.Create(percentAccuracy, outputRatio); Tuple <decimal, decimal, decimal> averagesOut = RunAverages(paystubs); return(Tuple.Create(paystubs, averagesOut, calcAccuracy)); }
public override void NodeGUI() { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); if (Inputs [0].connection != null) { GUILayout.Label(Inputs [0].name); } else { Input1Val = RTEditorGUI.FloatField(GUIContent.none, Input1Val); } InputKnob(0); // -- if (Inputs [1].connection != null) { GUILayout.Label(Inputs [1].name); } else { Input2Val = RTEditorGUI.FloatField(GUIContent.none, Input2Val); } InputKnob(1); GUILayout.EndVertical(); GUILayout.BeginVertical(); Outputs [0].DisplayLayout(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); #if UNITY_EDITOR type = (CalcType)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type); #else GUILayout.Label(new GUIContent("Calculation Type: " + type.ToString(), "The type of calculation performed on Input 1 and Input 2")); #endif if (GUI.changed) { NodeEditor.RecalculateFrom(this); } }