示例#1
0
        bool CheckIfCustomProbability()
        {
            bool customProb = false;

            VariableMixingType mixingType = (VariableMixingType)VariableProperty.FindPropertyRelative(nameof(IndependentVariable.MixingType)).intValue;

            customProb = mixingType == VariableMixingType.CustomProbability;


            return(customProb);
        }
示例#2
0
        protected override void DrawVariableSpecificInspector()
        {
            SerializedProperty blockProperty = VariableProperty.FindPropertyRelative(nameof(IndependentVariable.Block));

            CheckMaxBlockPermutationsAllowed(blockProperty.boolValue);



            EditorGUILayout.PropertyField(blockProperty);

            SerializedProperty mixType = VariableProperty.FindPropertyRelative(nameof(IndependentVariable.MixingType));
            VariableMixingType op      = (VariableMixingType)mixType.intValue;

            op = (VariableMixingType)EditorGUILayout.EnumPopup("Mixing Type", op);
            mixType.intValue = (int)op;



            if (valuesProperty.arraySize == 0)
            {
                VariableValidationResults.AddWarning("No values");
            }

            bool isCustomProbability = CheckIfCustomProbability();

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            valuesList.DoLayoutList();
            EditorGUILayout.Space();

            if (isCustomProbability)
            {
                CalculateFinalProbability();
                CheckProbabilityErrors(true);
            }


            if (waitingToClearAllValues)
            {
                int n = valuesProperty.arraySize;
                for (int i = 0; i < n; i++)
                {
                    RemoveValue(0);
                    RemoveProbability(0);
                }

                waitingToClearAllValues = false;
            }
        }
示例#3
0
        protected override void DrawVariableSpecificInspector()
        {
            EditorGUI.indentLevel++;

            SerializedProperty constrainProperty = VariableProperty.FindPropertyRelative("ConstrainValues");

            EditorGUILayout.PropertyField(constrainProperty);

            if (constrainProperty.boolValue)
            {
                EditorGUILayout.LabelField("Possible Values");
                valuesList.DoLayoutList();
            }
            EditorGUI.indentLevel--;
        }
示例#4
0
        protected override void DrawVariableSpecificInspector()
        {
            SerializedProperty defaultValueProperty = VariableProperty.FindPropertyRelative("DefaultValue");

            EditorGUILayout.PropertyField(defaultValueProperty);
        }