Beispiel #1
0
    void DrawItem()
    {
        contentColor    = GUI.contentColor;
        backgroundColor = GUI.backgroundColor;

        string oldStringValue = string.Empty;
        int    oldIntValue    = 0;

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("ID:", GUILayout.Width(100));
        oldStringValue = itemData.id;
        itemData.id    = EditorGUILayout.TextField(itemData.id, GUILayout.Width(150));
        if (itemData.id != oldStringValue)
        {
            dirty = true;
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Name:", GUILayout.Width(100));
        oldStringValue = itemData.name;
        itemData.name  = EditorGUILayout.TextField(itemData.name, GUILayout.Width(150));
        if (itemData.name != oldStringValue)
        {
            dirty = true;
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Description:", GUILayout.Width(100));
        oldStringValue       = itemData.description;
        itemData.description = EditorGUILayout.TextField(itemData.description, GUILayout.Width(150));
        if (itemData.description != oldStringValue)
        {
            dirty = true;
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Objective ID:", GUILayout.Width(100));
        oldStringValue       = itemData.objectiveId;
        itemData.objectiveId = EditorGUILayout.TextField(itemData.objectiveId, GUILayout.Width(150));
        if (itemData.objectiveId != oldStringValue)
        {
            dirty = true;
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Separator();
        EditorHelpers.DrawDateTime("Start Time:", ref itemData.startTime, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawDateTime("End Time:", ref itemData.endTime, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfStrings("Levels:", itemData.levels, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfStrings("Afinity Items:", itemData.affinityItems, ref dirty, 100f, 200f);

        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfEventPrizeData("Rank Prizes:", itemData.rankPrizes, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfEventPrizeData("Progression Prizes:", itemData.progressionPrizes, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfAssetData("Assets:", itemData.assets, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfGenericPropertyData("Properties:", itemData.properties, ref dirty);
        EditorGUILayout.Separator();
        EditorHelpers.DrawListOfGameElemetData("Restrictions:", itemData.restrictions, ref dirty);

        EditorGUILayout.Separator(); EditorGUILayout.Separator(); EditorGUILayout.Separator();
    }