Behaviour attributes


This is the documentation for Arbor 3.2.4 and earlier.

See Arbor Documentation for the latest documentation.

Some scripts such as StateBehaviour, Calculator, and ActionBehaviour have several usable attributes.

Target scripts

The scripts that can be used for the attributes introduced below are as follows.

  • StateBehaviour
  • Calculator
  • ActionBehaviour
  • Decorator
  • Service

AddBehaviourMenu

Attribute that can specify the path in the add behaviour menu.

Script Reference : AddBehaviourMenu

Example

Script

Create a script named TestAddBehaviourMenu and write the following code.

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

[AddBehaviourMenu("ManualExample/TestAddBehaviourMenu")]
[AddComponentMenu("")]
public class TestAddBehaviourMenu : StateBehaviour
{
}

Operation check

Click “Add Behavior” of the state and check it in the add behaviour menu window.

GIF

HideBehaviour

Attribute to hide in add behaviour menu.

Script Reference : HideBehaviour

Example

Script

Create a script named TestHideBehaviour and write the following code.

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

[HideBehaviour]
[AddComponentMenu("")]
public class TestHideBehaviour : StateBehaviour
{
}

Operation check

Click “Add Behaviour” in the state and check that it is hidden in the behavior added menu window.

If not specified, there should be only one TestHideBehaviour in the Scripts group, but since the TestHideBehaviour is hidden, the Scripts group is no longer displayed.

BehaviourTitle

Specify the name displayed in the behaviour’s title bar.

Script Reference : BehaviourTitle

Example

Script

Create a script named TestBehaviourTitle and write the following code.

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

[BehaviourTitle("Manual Example")]
[AddComponentMenu("")]
public class TestBehaviourTitle : StateBehaviour
{
}

Operation check

Select “Scripts / TestBehaviourTitle” from the “Add Behaviour” of the state and check the title bar of the behavior.

GIF

BehaviourHelp

This attribute specifies the URL to be opened by clicking the help button of the behaviour title bar.

Script Reference : BehaviourHelp

Exampple

Script

Create a script named TestBehaviourHelp and write the following code.

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

[BehaviourHelp("https://assetstore.unity.com/packages/slug/112239")]
[AddComponentMenu("")]
public class TestBehaviourHelp : StateBehaviour
{
}

Operation check

Select “Scripts / TestBehaviourHelp” from “add behavior” of state and click the help button displayed in the behaviour title bar.

GIF