August 2018
Beginner
334 pages
10h 19m
English
Just like decisions trees, we will create three pseudo-abstract classes for handling the process:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Task : MonoBehaviour
{
public List<Task> children;
protected bool result = false;
protected bool isFinished = false;
}
public virtual void SetResult(bool r)
{
result = r;
isFinished = true;
}
public virtual IEnumerator Run()
{
SetResult(true);
yield break;
}
Read now
Unlock full access