Astra Plugin Documentation

Getting Started

1. Download Dependency

Download the required dependency file: AstraPlugin.dll

2. Create Project

In Visual Studio, create a Class Library (.NET Framework 4.8) project

3. Add Reference

Add a reference to the downloaded AstraPlugin.dll file

4. Example Code

Use this example code as a starting point:

using static AstraModule.AstraModuleBase;

namespace AstraPluginExample
{
    public class ExampleMod : ModuleBase
    {
        public override string Name => $"Example Mod";
        public override string ToolTip => "Mod for example yeah.";
        public override ModuleCategory Category { get; set; } = ModuleCategory.Plugin;
        public override bool IsEnabled { get; set; } = false;

        public ExampleMod()
        {
            SetModes("Mode1", "Mode2", "Mode3", "Mode4");
        }

        public override void onEnable()
        {
            switch (ActiveMode)
            {
                case "Mode1":
                    UnityEngine.Debug.Log("Module turned on with mode 1!");
                    break;
                case "Mode2":
                    UnityEngine.Debug.Log("Module turned on with mode 2!");
                    break;
                case "Mode3":
                    UnityEngine.Debug.Log("Module turned on with mode 3!");
                    break;
                case "Mode4":
                    UnityEngine.Debug.Log("Module turned on with mode 4!");
                    break;
            }
        }

        public override void onDisable() {} // When the mod disables.

        public override void onUpdate() {} // Gets called on update (loop).

        public override void onGUI() {} // Make GUI's here using UnityEngine's UI System.
    }
}