Пример #1
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EditorGUILayout.PropertyField(s_itemDatabase, new GUIContent("Item Database: "));

        if (source.ItemDatabase != null)
        {
            //draw the popup/enum for selecting items
            source.itemId = EditorGUILayout.Popup(source.itemId, source.ItemDatabase.ItemsNames.ToArray());

            EditorGUILayout.PropertyField(s_giveItem, new GUIContent("Give Item: "));

            //draw item entry
            DrawItemEntry(source.CurrentItem);

            EditorExtensions.DrawActionsArray(s_yesActions, "Yes Actions: ");
            //EditorGUILayout.PropertyField(s_yesActions, new GUIContent("Yes Actions: "), true);
            EditorExtensions.DrawActionsArray(s_noActions, "No Actions: ");
            //EditorGUILayout.PropertyField(s_noActions, new GUIContent("No Actions: "), true);
        }

        if (GUI.changed)
        {
            if (source.ItemDatabase != null)
            {
                source.ChangeItem(source.ItemDatabase.GetItem(source.itemId));
            }

            EditorUtility.SetDirty(source);
            EditorSceneManager.MarkSceneDirty(source.gameObject.scene);
        }

        serializedObject.ApplyModifiedProperties();
    }
Пример #2
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        //show add message
        if (GUILayout.Button("Add Message"))
        {
            s_messages.InsertArrayElementAtIndex(s_messages.arraySize);
        }

        //loop thru our message list
        for (int i = 0; i < s_messages.arraySize; i++)
        {
            DrawMessagesEntry(s_messages.GetArrayElementAtIndex(i), "Message " + (i + 1), i);
        }

        //show enableDialog toggle, if enabled, then show the dialog properties
        GUILayout.BeginVertical("box");

        EditorGUILayout.PropertyField(s_enableDialog, new GUIContent("Enable Dialog:"));

        if (s_enableDialog.boolValue)
        {
            EditorGUILayout.PropertyField(s_yesText, new GUIContent("Yes Button Label"), GUILayout.Height(30f));
            EditorExtensions.DrawActionsArray(s_yesActions, "Yes Actions");

            EditorGUILayout.PropertyField(s_noText, new GUIContent("No Button Label"), GUILayout.Height(30f));
            EditorExtensions.DrawActionsArray(s_noActions, "No Actions");
        }

        GUILayout.EndVertical();

        serializedObject.ApplyModifiedProperties();
    }
Пример #3
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        if (GUILayout.Button("Add Animation Parameter"))
        {
            anims.InsertArrayElementAtIndex(anims.arraySize);
        }

        //draw the anims inpesctor
        for (int i = 0; i < anims.arraySize; i++)
        {
            DrawAnimsInspector(anims.GetArrayElementAtIndex(i), i);
        }

        EditorExtensions.DrawActionsArray(actions, "Actions Chaining:");

        serializedObject.ApplyModifiedProperties();
    }