For AI agents: the complete documentation index is available at /AchReactive/en/llms.txt, the full documentation bundle is available at /AchReactive/en/llms-full.txt, and this page is available as Markdown at /AchReactive/en/getting-started.md.

Getting started

Installation

In the Unity Package Manager, choose Add package from git URL and enter the following address.

https://github.com/achieveonepark/AchReactive.git

Or add it directly to Packages/manifest.json.

{
  "dependencies": {
    "com.achieve.reactive": "https://github.com/achieveonepark/AchReactive.git"
  }
}

The requirement is Unity 2021.3 or later. The only dependency is com.unity.nuget.newtonsoft-json, which is installed automatically.

1. Implement the integration boundary

AchReactive does not impose a structure on your game. You only need to implement two interfaces.

  • IEntity — the subject/target of a reaction (characters, monsters, etc.)
  • IWorld — the world boundary for spawning, range queries, etc.
using AchReactive;
using UnityEngine;

public sealed class Character : MonoBehaviour, IEntity
{
    public StatSheet Stats { get; } = new StatSheet();   // provided by the package, use as is
    public string Id => name;
    public Vector3 Position { get => transform.position; set => transform.position = value; }
    public bool IsAlive => Stats.GetBase(StatKeys.Hp) > 0f;

    void Awake()
    {
        Stats.SetBase(StatKeys.Hp, 100f);
        Stats.SetBase(StatKeys.HpMax, 100f);
        Stats.SetBase(StatKeys.Atk, 10f);
        Stats.SetBase(StatKeys.Def, 2f);
    }
}

2. Author the data

Define skills as JSON in the reactions format. (You can also build them with the Data Editor instead of writing them by hand.)

[
  {
    "id": "fire_slash",
    "cooldown": 5.0,
    "reactions": [
      {
        "trigger": "on_use",
        "conditions": [{ "type": "alive" }],
        "effects": [
          { "type": "damage", "params": { "power": 1.8 } },
          { "type": "log", "params": { "message": "fire_slash 명중!" } }
        ]
      }
    ]
  }
]

3. Assemble and run

using AchReactive;

var skills = new DataBase<SkillData>();
var engine = new ReactionEngine();

void Start()
{
    // Auto-collect the behavior pool (includes default damage/heal/…)
    EffectRegistry.AutoRegister();
    ConditionRegistry.AutoRegister();
    TriggerRegistry.AutoRegister();

    // Load data — any source you like
    skills.Load(new JsonDataLoader<SkillData>(() => skillsJson.text));
}

void UseSkill(IEntity caster, IEntity target)
{
    var ctx = new ReactionContext { Source = caster, Target = target };
    engine.Run("on_use", skills.Get("fire_slash"), ctx);
}

Default effects like damage, heal, and add_modifier are provided by the package, so no extra code is required. You can immediately see a working scene in the Basic example under Samples.

Next steps