Ejemplo n.º 1
0
    public static AITreeDefinition DrawDefinitionEditor(AITreeDefinition value, string label)
    {
        GUILayout.Label(label);
        GUILayout.Label("AI Tree Definition");
        value.name = EditorGUILayout.TextField("Name", value.name);

        value.arguments = EditorGUICustomUtility.DrawArrayEditor(
            value.arguments,
            (x) =>
        {
            var newType  = GenericCustomEditors.AllEnumField <TypeEnumAttribute>(x.type, "");
            var newValue = EditorGUILayout.TextField("", x.value);
            if (newType != x.type || newValue != x.value)
            {
                return(new AITreeDefinitionArgument(newType, newValue));
            }
            else
            {
                return(x);
            }
        },
            "Add Argument",
            () => new AITreeDefinitionArgument(null, ""),
            false);

        return(value);
    }
    public static MemoryMethodBindingArgument DrawDynamicethodBindingArgumentEditor(MemoryMethodBindingArgument dynamicArgument, string label)
    {
        var output = GenericCustomEditors.AllEnumField <BindableEnumAttribute>(dynamicArgument.ArgumentKey, dynamicArgument.argName);

        if (output != dynamicArgument.ArgumentKey)
        {
            dynamicArgument.ArgumentKey = output;
        }
        return(dynamicArgument);
    }