Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

C# OnReady Plugin

An asset by dehyvis.lecuna
The page banner background of a mountain and forest
C# OnReady Plugin hero image

Quick Information

0 ratings
C# OnReady Plugin icon image
dehyvis.lecuna
C# OnReady Plugin

This plugin provides an extension to Godot's functionality, emulating the @onready directive from GDScript within C# scripts.

Supported Engine Version
4.1
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

CS_OnReady Plugin for Godot

This plugin provides an extension to Godot's functionality, emulating the @onready directive from GDScript within C# scripts.

Installation

  1. Clone this repository or download the ZIP.
  2. Copy the cs_onready_plugin folder into your addons directory in your Godot project.
  3. Activate the plugin through the Project > Project Settings > Plugins menu.

Usage

To use the plugin:

  1. Ensure the plugin is active.
  2. In your C# script, add the necessary OnReadyCs namespace at the top.
  3. In your C# script, use the [OnReady("Path/To/Your/Node")] attribute before any field you wish to initialize using the specified node.
  4. In your script's _Ready() method, call this.InitializeOnReadyFields();.

Example:

First, add the necessary using directive:

using Godot;
using OnReadyNameSpace;

Then, in your script:

[OnReady("Path/To/SomeNode")]
private SomeNodeType myNode;

public override void _Ready()
{
    this.InitializeOnReadyFields();
    // Now, myNode is initialized and ready to use.
}

Contributing

  1. Fork the repository on GitHub.
  2. Clone the forked repository to your local machine.
  3. Commit your changes to your fork.
  4. Push your work back up to your fork on GitHub.
  5. Submit a Pull request so that we can review your changes.

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

This plugin provides an extension to Godot's functionality, emulating the @onready directive from GDScript within C# scripts.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
C# OnReady Plugin icon image
dehyvis.lecuna
C# OnReady Plugin

This plugin provides an extension to Godot's functionality, emulating the @onready directive from GDScript within C# scripts.

Supported Engine Version
4.1
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers