Exemplo n.º 1
0
        public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
        {
            rect.height = DrawUtils.LINE_HEIGHT;

            var rectHead  = new Rect(rect.x, rect.y, rect.width, rect.height);
            var rectMoney = DrawUtils.LineDown(rectHead);

            rectMoney.width /= 2;
            var rectRep  = new Rect(rectMoney.x + rectMoney.width, rectMoney.y, rectMoney.width, rect.height);
            var rectMood = DrawUtils.LineDown(rect, 2);

            EditorGUI.LabelField(rectHead, "Deltas:", new GUIStyle()
            {
                fontStyle = FontStyle.Bold
            });
            EditorGUI.indentLevel += 1;
            DrawUtils.DrawHeadValueInLine(rectMoney, "Money:", 70, property.FindPropertyRelative("moneyDelta"));
            DrawUtils.DrawHeadValueInLine(rectRep, "Rep:", 70, property.FindPropertyRelative("repDelta"));

            var moodHeads = System.Enum.GetNames(typeof(AuditoryType));
            var moodProps = DrawUtils.GetPreparedArray(property.FindPropertyRelative("moodsDeltas"), moodHeads.Length);

            DrawUtils.DrawArray(rectMood, moodHeads, 60, moodProps, inLine: true);
            EditorGUI.indentLevel -= 1;

            EditorUtility.SetDirty(property.serializedObject.targetObject);
        }
Exemplo n.º 2
0
        public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
        {
            rect.height = DrawUtils.LINE_HEIGHT;

            var rectHead = new Rect(rect.x, rect.y, rect.width, rect.height);
            var rectTask = DrawUtils.LineDown(rectHead);

            EditorGUI.LabelField(rectHead, "Causings:", new GUIStyle()
            {
                fontStyle = FontStyle.Bold
            });
            EditorGUI.indentLevel += 1;
            DrawUtils.DrawHeadValueInLine(rectTask, "Task:", 60, property.FindPropertyRelative("task"));
            EditorGUI.indentLevel -= 1;

            EditorUtility.SetDirty(property.serializedObject.targetObject);
        }