August 2018
Beginner
334 pages
10h 19m
English
We can create custom decisions and actions starting from the pseudo-abstract classes we've already created; for example, a decision on whether to attack or run away from the player.
The following code snippet demonstrates the custom Boolean decision:
using UnityEngine;
using System.Collections;
public class DecisionBool : Decision
{
public bool valueDecision;
public bool valueTest;
public override Action GetBranch()
{
if (valueTest == valueDecision)
return nodeTrue;
return nodeFalse;
}
}
Read now
Unlock full access