public bool IsValidOn(IBlackboardComponent blackboard) { var currentX = blackboard.GetValue <float>(key.Index); var currentY = blackboard.GetValue <float>((ushort)(key.Index + sizeof(float))); var currentZ = blackboard.GetValue <float>((ushort)(key.Index + sizeof(float) + sizeof(float))); return(invert != ((Mathf.Abs(currentX - value.x) <= tolerance.x) && (Mathf.Abs(currentY - value.y) <= tolerance.y) && (Mathf.Abs(currentZ - value.z) <= tolerance.z))); }
public override ExecutionStatus Execute(float deltaTime) { var location = _blackboard.GetValue <Vector3>(_locationKey.Index); _target.eulerAngles = new Vector3( 0, Quaternion.LookRotation(location - _target.position, Vector3.up).eulerAngles.y, 0); return(ExecutionStatus.Succeeded); }
public void ApplyTo(IBlackboardComponent blackboard) => blackboard.SetValue <byte>(key.Index, (byte)(1 - blackboard.GetValue <byte>(key.Index)));
public bool IsValidOn(IBlackboardComponent blackboard) => blackboard.GetValue <byte>(key.Index) == value.ToByte();
public override void OnExecutionStart() { var targetPosition = _blackboard.GetValue <Vector3>(_targetPositionKey); UpdateNavMeshAgentDestination(targetPosition); }
public bool IsValidOn(IBlackboardComponent blackboard) => invert != (Mathf.Abs(blackboard.GetValue <float>(key.Index) - value) <= tolerance);
public void ApplyTo(IBlackboardComponent blackboard) => blackboard.SetValue <int>(key.Index, blackboard.GetValue <int>(key.Index) + blackboard.GetValue <int>(toAdd.Index));