Customize Service


By creating a Service script, you can add your own update processing etc. by describing the processing you want to do.

Create Service script file

  • Right click at the place you want to create from the Project window.
  • From the right-click menu, select “Create> Arbor> Behavior tree> Service C# Script”.
  • Enter the file name and confirm

Function to be called

When you add the created Service to the Composite node or Action node, each function of the script will be called.

  • OnAwake
    It is called the first time the node becomes active.
  • OnStart
    It is called when the node becomes active.
  • OnUpdate
    Called each time the node is active.
    For details about the execution timing, see Behavior tree’s UpdateSettings.
    http://arbor-docs.caitsithware.com/en/components/behaviourtree.html
  • OnAbort
    Called when the node is interrupted by the Decorator.
  • OnEnd
    Called when the node exits.

Call order

  • If more than one service is added to the node, it is called from the top in order.
  • You can also use the callback method of MonoBehaviour other than OnEnable and OnDisable, but please be aware that Start() will be called after the first OnUpdate().

Declaring variables

You can edit it in Arbor Editor by declaring a field with public or SerializedField attribute added to the created script.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Arbor;
using Arbor.BehaviourTree;

[AddComponentMenu("")]
public class TestService : Service
{
	public string myName;
	// The rest is omitted.
}

You can also use CalculatorSlot and Flexible classes as well as StateBehaviour.

Privacy Preference Center

Your Privacy

This site uses cookies to display contents and advertisements tailored to users, provide social media functions, measure advertisement impressions and clicks. We also gather information on users' site usage status and provide them to social media, advertisement distribution and data analysis partners. Each partner may use this information in combination with other information that the user provided to each partner or other information gathered when the user used the service of each partner.

Analytics, Ads