lab  2016-03-28
lightweight ai behaviour trees framework for Unity 3D
lab.ATaskScript Class Referenceabstract

Abstract class for task implementation. More...

Inherits MonoBehaviour.

Public Member Functions

abstract bool Execute ()
 The method that will be invoked by binded TaskNode with current ATaskScript. More...
 

Detailed Description

Abstract class for task implementation.

Logic nodes need to be binded with implementations. Scripts that inherits ATaskScript should be attached to your game object and added to AiController's slot. TaskNodes' index reference to the AiControllers' slot index.

Example below shows simple follow task implementation should look like.

using lab;
public class FollowTask : ATaskScript {
@verbatim
public Transform follow;
public override bool Execute() {
transform.position = Vector3.Lerp(transform.position, follow.position, Time.smoothDeltaTime);
return true;
}
@endverbatim
}

Member Function Documentation

abstract bool lab.ATaskScript.Execute ( )
pure virtual

The method that will be invoked by binded TaskNode with current ATaskScript.

Returns
The result of execution. If true, TaskNode binded with current ATaskScript will return true, otherwise node will return false.

The documentation for this class was generated from the following file: