# Login Dialog

```csharp
using UnityEngine;
using VoxelBusters.CoreLibrary;
using VoxelBusters.EssentialKit;


public class LoginView : MonoBehaviour
{
    public void Show()
    {
        //Construct the alert builder
        AlertDialogBuilder builder = new AlertDialogBuilder();
        builder.SetTitle("Log in");
        builder.SetMessage("To access you account need to log in");

        //Create text input field options for entering email
        var emailInputOptions = new TextInputFieldOptions.Builder()
            .SetPlaceholderText("Enter your email here")
            .SetKeyboardInputType(KeyboardInputType.EmailAddress)
            .Build();        

        //Create text input field options for entering password
        var passwordInputOptions = new TextInputFieldOptions.Builder()
            .SetPlaceholderText("Enter your password here")
            .SetIsSecured(true)
            .Build();  
                                
        builder.AddTextInputField(emailInputOptions);
        builder.AddTextInputField(passwordInputOptions);
        builder.AddButton("Log in", (string[] inputValues) => {
            Debug.Log($"Entered email address : {inputValues[0]}");                 
            Debug.Log($"Entered email password : {inputValues[1]}");                                               
        });
        builder.AddButton("Cancel", () => Debug.Log("Cancel clicked"));
    
    
        //Build the dialog from constructed builder and show
        AlertDialog dialog = builder.Build();
        dialog.Show();
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://assetstore.essentialkit.voxelbusters.com/features/native-ui/examples/login-dialog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
