Creating custom tasks
Example: Log Message Task
using Ilumisoft.GameActionSystem;
using UnityEngine;
/// <summary>
/// Logs the given message when being executed
/// </summary>
[AddComponentMenu("Game Action System/Tasks/Debug/Log Message (Task)")]
public class LogMessageTask : GameActionTask
{
/// <summary>
/// A message that can be defined in the inspector
/// </summary>
public string message = string.Empty;
/// <summary>
/// This will be invoked when the task is executed
/// </summary>
/// <returns></returns>
protected override StatusCode OnExecute()
{
// Log the message
Debug.Log(message);
// As the task is completed, when return the completed status code
return StatusCode.Completed;
}
}Example: Wait Until Key Pressed Task
Last updated