Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt

Use this file to discover all available pages before exploring further.

MonoBehaviour is the abstract base class for every script you attach to a GameObject in Prowl. You never instantiate it directly — instead you derive a class from it, add it to a GameObject via AddComponent<T>(), and override whichever lifecycle methods your script needs. The engine calls those methods at well-defined points in the frame: Awake once at creation, Start before the first active frame, Update every frame, FixedUpdate on physics ticks, and LateUpdate after all Update calls. MonoBehaviour also inherits the full identity, destruction, and cloning API from EngineObject, and mirrors the entire component query API of GameObject for convenience.
MonoBehaviour carries [CloneBehavior(CloneBehavior.ChildObject)], which means copies of a GameObject deep-copy its components rather than sharing references. To preserve a component’s stable GUID across copies the Identifier field is marked [CloneField(CloneFieldFlags.IdentityRelevant)].

Core Properties

GameObject
GameObject
The GameObject this component is attached to. Set automatically when the component is added via AddComponent.
public GameObject GameObject { get; }
Transform
Transform
Shortcut to GameObject.Transform. Equivalent to calling GameObject.Transform.
public Transform Transform { get; }
Enabled
bool
Whether this component is individually enabled. Setting false triggers OnDisable; setting true triggers OnEnable. Does not affect sibling components.
public bool Enabled { get; set; }
EnabledInHierarchy
bool
true only when this component is enabled and its GameObject is enabled in the hierarchy. Read-only; updated automatically.
public bool EnabledInHierarchy { get; }
Tag
string
The tag string of the owning GameObject. Shortcut for GameObject.tag.
public string Tag { get; }
Scene
Scene?
The scene the owning GameObject belongs to. null if the object has not been added to a scene.
public Scene? Scene { get; }
Identifier
Guid
Persistent GUID for this component instance. Survives serialization round-trips. Used by the prefab system to correlate components across copies.
public Guid Identifier { get; set; }
hideFlags
HideFlags
Controls visibility of this component in the editor inspector and serialization output.
[HideInInspector]
public HideFlags hideFlags;
HasAwoken
bool
true after Awake has been called. The engine checks this flag to ensure Awake is only called once.
public bool HasAwoken { get; internal set; }
HasStarted
bool
true after Start has been called. OnDestroy is only invoked when this is true.
public bool HasStarted { get; internal set; }
ExecuteAlways
bool
When true (set by [ExecuteAlways] attribute), lifecycle methods fire even when the game is not in play mode. Normally controlled by the attribute rather than set at runtime.
public bool ExecuteAlways { get; internal set; }

Lifecycle Methods

Override any of the following public virtual methods in your derived class. You do not call the base implementation unless you explicitly need to chain behavior.

Awake

Called once when the component is first created (or when the GameObject is instantiated), before any Start calls on any object. Use this to set up internal state that does not depend on other objects.
public virtual void Awake() { }
Awake fires even when the component is disabled. Use it for initialization that must happen regardless of enabled state.

OnEnable

Called when the component becomes active — either when Awake completes (if already active) or whenever Enabled transitions to true.
public virtual void OnEnable() { }

Start

Called once, on the first frame the component is active and after all Awake calls for the current frame have completed. Safe to reference other components here.
public virtual void Start() { }

Render Hooks

These methods are called by the rendering pipeline. They only fire on components attached to the same GameObject as the relevant Camera, unless noted.
DrawGizmos
virtual void
Called by the editor’s gizmo pass. Draw debug shapes and handles for every object in the scene.
public virtual void DrawGizmos() { }
DrawGizmosSelected
virtual void
Same as DrawGizmos but only fires when this object is selected in the editor hierarchy.
public virtual void DrawGizmosSelected() { }
OnGUI
virtual void
Called for in-game/runtime UI rendering on any camera with a GUILayer component.
public virtual void OnGUI(Gui gui) { }
gui
Gui
required
The Prowl GUI context for this frame. Use it to issue draw calls and handle input.
OnRenderImage
virtual void
Called after the camera attached to this GameObject has rendered the scene. Implement post-processing effects here. Apply [ImageEffectOpaqueAttribute] to your class to run before transparent geometry.
public virtual void OnRenderImage(RenderTexture src, RenderTexture dest) { }
src
RenderTexture
required
The source render texture containing the rendered scene.
dest
RenderTexture
required
The destination render texture to write the processed image into.
OnPreCull
virtual void
Called right before the camera begins its culling pass.
public virtual void OnPreCull(Camera camera) { }
OnPreRender
virtual void
Called right before the camera starts rendering the scene (after culling).
public virtual void OnPreRender(Camera camera) { }
OnPostRender
virtual void
Called after the camera has finished rendering the scene.
public virtual void OnPostRender(Camera camera) { }

Coroutine API

Coroutines let you spread work across multiple frames without threads, using C#‘s IEnumerator / yield return syntax.
Prowl’s coroutine system is keyed by method name string, not by IEnumerator instance. You cannot have two concurrent coroutines with the same method name on the same component.

StartCoroutine

Starts a coroutine identified by its method name. The method must return IEnumerator and take no parameters.
public Coroutine StartCoroutine(string methodName)
methodName
string
required
The name of the coroutine method. Leading and trailing whitespace is trimmed. Must exist on the component class (public, private, or protected).
returns
Coroutine
A Coroutine handle that can be yielded inside another coroutine to wait for completion. Returns null if the method was not found.
public override void Start()
{
    StartCoroutine("FadeIn");
}

private IEnumerator FadeIn()
{
    float alpha = 0f;
    while (alpha < 1f)
    {
        alpha += 0.05f;
        SetAlpha(alpha);
        yield return new WaitForSeconds(0.016f);
    }
}

StopCoroutine

Stops the coroutine with the given method name. Searches all three coroutine queues (regular, end-of-frame, and fixed-update). Has no effect if no coroutine with that name is running.
public void StopCoroutine(string methodName)
methodName
string
required
The name of the coroutine method to stop.

StopAllCoroutines

Stops all running coroutines on this component (regular, end-of-frame, and fixed-update queues).
public void StopAllCoroutines()
public override void OnDisable()
{
    StopAllCoroutines(); // clean up on disable
}

Yield Instructions

Use these inside a coroutine’s yield return statement to pause execution.
Suspends the coroutine until Time.time reaches the value of Time.time + seconds at the moment of construction.
public class WaitForSeconds : YieldInstruction
{
    public double Duration { get; private set; }
    public WaitForSeconds(float seconds)
}
yield return new WaitForSeconds(2.5f); // wait approx 2.5 s
Resumes the coroutine at the very end of the current frame, after all cameras and GUI have been rendered, just before the frame is presented to the display.
public class WaitForEndOfFrame : YieldInstruction { }
yield return new WaitForEndOfFrame();
Resumes the coroutine on the next physics fixed-update tick (next call to SceneManager.PhysicsUpdate).
public class WaitForFixedUpdate : YieldInstruction { }
yield return new WaitForFixedUpdate();
You can yield a Coroutine handle returned by StartCoroutine to wait until that coroutine finishes.
public sealed class Coroutine : YieldInstruction
{
    // isDone and Enumerator are internal — managed by the engine
}
private IEnumerator Master()
{
    Coroutine sub = StartCoroutine("SubRoutine");
    yield return sub; // wait until SubRoutine completes
    Debug.Log("SubRoutine done!");
}

Component API (mirrors GameObject)

MonoBehaviour exposes the full component query API of GameObject as convenience methods so you do not need to write GameObject.GetComponent<T>() everywhere.
public T AddComponent<T>() where T : MonoBehaviour, new()
public MonoBehaviour AddComponent(Type type)
public void RemoveComponent<T>(T component) where T : MonoBehaviour
public void RemoveComponent(MonoBehaviour component)
public void RemoveSelf()   // removes this component from its GameObject

Messaging

public void BroadcastMessage(string methodName, params object[] objs)
public void SendMessage(string methodName, params object[] objs)
public bool CompareTag(string otherTag)
BroadcastMessage delegates to GameObject.BroadcastMessage (this object + all children). SendMessage delegates to GameObject.SendMessage (this object only). CompareTag delegates to GameObject.CompareTag.

Sibling Index

Controls the order of this component within the owning GameObject’s component list. Components are sorted by [ExecutionOrder] on AddComponent, but you can fine-tune with sibling index. Returns null when the component has no owning GameObject.
public int? GetSiblingIndex()
public void SetSiblingIndex(int index)

Attributes

Apply these attributes to your MonoBehaviour subclass to configure engine behavior.

[AddComponentMenu]

Controls where the component appears in the editor’s Add Component menu.
[AddComponentMenu("Effects/Bloom Controller")]
public class BloomController : MonoBehaviour { }
Path
string
The menu path, using / as separator.

[ExecuteAlways]

Makes lifecycle methods (Update, Awake, etc.) run even when the editor is not in play mode.
[ExecuteAlways]
public class GridSnap : MonoBehaviour { }

[ExecutionOrder]

Sets a numeric priority that determines component update order. Lower numbers run first. Default is 0.
[ExecutionOrder(-100)]
public class InputManager : MonoBehaviour { }
Order
int
Execution priority. Negative values run before the default; positive values run after.

[RequireComponent]

Declares component dependencies. Prowl automatically adds missing required types when this component is added to a GameObject, and prevents removal if a dependent is present.
[RequireComponent(typeof(Rigidbody))]
public class Vehicle : MonoBehaviour { }
types
Type[]
One or more component types that must co-exist on the same GameObject.

Image Effect Attributes

These attributes are applied at the class level to modify the behavior of OnRenderImage callbacks.
AttributeEffect
[ImageEffectOpaque]Runs OnRenderImage before the transparent geometry pass.
[ImageEffectAllowedInSceneView]The effect is also applied in the editor scene view camera.
[ImageEffectTransformsToLDR]Signals that this effect converts the buffer from HDR to LDR.
[ImageEffectOpaque]
[ImageEffectAllowedInSceneView]
public class DepthFog : MonoBehaviour
{
    public override void OnRenderImage(RenderTexture src, RenderTexture dest)
    {
        // apply fog effect
    }
}

Minimal Script Example

using Prowl.Runtime;

[AddComponentMenu("Gameplay/Rotate Object")]
[ExecutionOrder(10)]
public class RotateObject : MonoBehaviour
{
    public float speed = 45f;  // degrees per second

    public override void Awake()
    {
        Debug.Log($"{Name} awakening");
    }

    public override void Update()
    {
        Transform.localEulerAngles += new System.Numerics.Vector3(0, speed * Time.deltaTime, 0);
    }

    public override void OnDestroy()
    {
        Debug.Log($"{Name} destroyed");
    }
}

Build docs developers (and LLMs) love