Exemple #1
0
    protected override void DrawReaction()
    {
        serializedObject.Update();

        CheckAndCreateSubEditors(interactableCallback.conditionCollections);

        for (int i = 0; i < subEditors.Length; i++)
        {
            subEditors[i].OnInspectorGUI();
            EditorGUILayout.Space();
        }

        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Add Collection", GUILayout.Width(collectionButtonWidth)))
        {
            ConditionCollection newCollection = ConditionCollectionEditor.CreateConditionCollection();
            collectionsProperty.AddToObjectArray(newCollection);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space();

        EditorGUILayout.PropertyField(defaultReactionCollectionProperty);


        serializedObject.ApplyModifiedProperties();
    }
Exemple #2
0
    public static ConditionReactionCollection CreateConditionReactionCollection()
    {
        ConditionReactionCollection newConditionReactionCollection = CreateInstance <ConditionReactionCollection>();

        newConditionReactionCollection.conditionCollection =
            ConditionCollectionEditor.CreateConditionCollection("Default_Condtion_Collection", "Default_Condition");
        newConditionReactionCollection.reactionCollection =
            ReactionCollectionEditor.CreateReactionCollection("Default_Reaction_Collection", "Default_Reaction");

        return(newConditionReactionCollection);
    }