protected override void OnNodeInspectorGUI()
        {
            if (outConnections.Count == 0)
            {
                GUILayout.Label("Make some connections first");
                return;
            }

            CalcTotal();

            for (int i = 0; i < childWeights.Count; i++)
            {
                GUILayout.BeginHorizontal();
                childWeights[i] = (BBFloat)EditorUtils.BBVariableField("Weight", childWeights[i]);
                GUILayout.Label(Mathf.Round((childWeights[i].value / total) * 100) + "%", GUILayout.Width(30));
                GUILayout.EndHorizontal();
            }

            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            failChance = (BBFloat)EditorUtils.BBVariableField("Direct Failure Chance", failChance);
            GUILayout.Label(Mathf.Round((failChance.value / total) * 100) + "%", GUILayout.Width(30));
            GUILayout.EndHorizontal();
        }
Esempio n. 2
0
        protected override void OnNodeInspectorGUI()
        {
            limitMode = (LimitMode)UnityEditor.EditorGUILayout.EnumPopup("Mode", limitMode);

            if (limitMode == LimitMode.CoolDown)
            {
                coolDownTime = (BBFloat)EditorUtils.BBVariableField("CoolDown Time", coolDownTime);
            }
            else
            if (limitMode == LimitMode.LimitNumberOfTimes)
            {
                maxCount = (BBInt)EditorUtils.BBVariableField("Max Times", maxCount);
            }

            inactiveWhenLimited = UnityEditor.EditorGUILayout.Toggle("Inactive When Limited", inactiveWhenLimited);
        }