public TreeAction(float probability, TreeAction[] subActions = null, bool isLast = false, List <string> messages = default(List <string>), Action action = null, checkTypes checkType = checkTypes.NONE, float probabilityWithCheckedType = 0f) { this.messages = messages; this.probability = probability; this.subActions = subActions; this.isLast = isLast; this.message = messages[0]; run = action; this.checkType = checkType; this.probabilityWithCheckedType = probabilityWithCheckedType; }
bool CheckTheType(checkTypes type) { if (type == checkTypes.BALL_ON_SIDES) { return(CalculationsManager.IsPositionOnTheEdge(GameManager.instance.ballPosition)); } else if (type == checkTypes.PLAYER_ON_PENALTY) { return(CalculationsManager.IsPlayerOnPenaltyArea()); } else if (type == checkTypes.PLAYER_SAME_SECTOR_AS_BALL) { return(CalculationsManager.IsPlayerStandingOnBall()); } else { return(false); } }
public TreeAction(float probability, TreeAction[] subActions = null, bool isLast = false, string[] messages = default(string[]), Action action = null, checkTypes checkType = checkTypes.NONE, float probabilityWithCheckedType = 0f) : this(probability, subActions, isLast, messages.ToList <string>(), action, checkType, probabilityWithCheckedType) { }
public TreeAction(float probability, TreeAction[] subActions = null, bool isLast = false, string message = "", Action action = null, checkTypes checkType = checkTypes.NONE, float probabilityWithCheckedType = 0f) : this(probability, subActions, isLast, new List <string> { message }, action, checkType, probabilityWithCheckedType) { }