> For the complete documentation index, see [llms.txt](https://quickstart.crashkonijn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quickstart.crashkonijn.com/readme.md).

# Rabbit Quick Start

Rabbit Quick Start is a Unity package that simplifies and structures the process of initializing your Unity projects. It provides a flexible framework to define how your project boots up and manages scene loading.

## Profiles

At the core of Rabbit Quick Start is the concept of a **profile**. A profile is a ScriptableObject that outlines the startup behavior of your project, including which scene to load first (only available in the editor).

For example:

* A profile that skips the boot scene and directly loads the main gameplay scene.
* A profile that boots into a specific scene based on the platform (e.g., mobile vs. desktop).
* A profile that boots you into a specific scene with specific settings for testing purposes.

## Getting Started

1. Create a Quick Start Profile asset:
   * Right-click in the Project window and select `Create > Quick Start Profiles > SceneQuickStartProfile`.
   * Give it a name (e.g., `Profile A`).
   * Setup a boot scene in the profile asset.

![Creating a Quick Start Profile](/files/2QB2KvfTE9jBasMCy2Ql)

2. Add the toolbar to your Unity Editor:
   * Right click on the toolbar (next to the play button) and select `Quick Start > Profile Selector`.

![Adding the Quick Start Toolbar](/files/gK9SNzDrIB3z9iYQnJhU)

3. Select your profile from the toolbar dropdown.

![Selecting a Profile](/files/CrOaZ8wIbFqr1iOd12kZ)

4. Press Play to see your project boot using the selected profile!

## Project Settings

Rabbit Quick Start allows you to define different profiles for different platforms via project settings.

A settings asset is created by default in `Assets/Settings/QuickstartProjectSettings.asset`. Here you can setup different profiles to run for different platforms.

{% hint style="info" %}
Make sure to at least setup a default profile, the selected profile in the editor does not work in builds!
{% endhint %}

![Project Settings](/files/Ebd1zLyxTJqtwIutzeQj)

## Custom Profiles

You can create custom profiles by extending the `QuickStartProfile` class. This allows you to define specific startup behaviors and scene loading logic tailored to your project's needs.

Here's a simple example of a custom profile that sets a text to a ui element.

{% code lineNumbers="true" %}

```csharp
using System;
using CrashKonijn.Quickstart;
using TMPro;
using UnityEngine;

namespace CrashKonjin.QuickStart.Examples.Scripts
{
    [CreateAssetMenu(menuName = "QuickstartProfiles/ProfileWithText")]
    public class ProfileWithText : QuickStartProfile<ExampleContext>
    {
        // A custom text to set on startup
        [SerializeField]
        private string text;

        public override void Apply(ExampleContext context)
        {
            context.TextElement.text += $"\n{text}";
        }
    }
    
    public class ExampleContext
    {
        public TextMeshProUGUI TextElement { get; set; }
    }
}

```

{% endcode %}

{% code lineNumbers="true" %}

```csharp
using System;
using CrashKonijn.QuickStart;
using UnityEngine;
using TMPro;

namespace CrashKonjin.QuickStart.Examples.Scripts
{
    // Add this behaviour to a GameObject in your scene to see it in action
    public class ContextBehaviour : MonoBehaviour
    {
        // Reference the project settings to get the selected profile
        [SerializeField]
        private QuickStartProjectSettings settings;

        // Reference to a UI text element to modify
        [SerializeField]
        private TextMeshProUGUI text;
        
        public void Start()
        {
            var context = new ExampleContext
            {
                TextElement = this.text
            };
            
            this.settings.GetProfile().Apply(context);
        }
    }
}
```

{% endcode %}

## Referencing a profile

This is how you can reference and call a profile from your code.

{% code lineNumbers="true" %}

```csharp
public class ContextBehaviour : MonoBehaviour
{
    [SerializeField]
    private QuickStartProjectSettings settings;
    
    public void Start()
    {
        // A profile without context
        this.settings.GetProfile().Apply();
        
        // A profile with context
        this.settings.GetProfile().Apply(new ExampleContext
        {
            TextElement = this.text
        };);
    }
}
```

{% endcode %}

## Samples

The package includes examples that can be imported into your project via the Package Manager. These samples demonstrate how to create and use different profiles.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://quickstart.crashkonijn.com/readme.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.
