public override TaskStatus OnUpdate() { AISign aiSign = aiSignsHolder.getRandomAISign(aiSignLabelName.Value); if (aiSign != null) { lookAtTarget.SetValue(aiSign.transform); return(TaskStatus.Success); } else { lookAtTarget.SetValue(null); return(TaskStatus.Failure); } }
public void SetNavPoint(Transform navpoint) { if (_behavior_tree == null) { return; } SharedTransform innernav = (SharedTransform)_behavior_tree.GetVariable(AITreeArg.NavTarget); if (innernav != null) { innernav.SetValue(navpoint); } }
public Transform[] randomWaypoints; // Array of all possible waypoints public override TaskStatus OnUpdate() { // Generate Waypoint based on selected type switch (waypointType) { case waypointSelection.Random: // Set Random Waypoint int currentWaypoint = Random.Range(0, randomWaypoints.Length); generatedWaypoint.SetValue(randomWaypoints[currentWaypoint]); break; case waypointSelection.Target: break; } return(TaskStatus.Success); }