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)));
        }
Пример #2
0
        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);
        }
Пример #3
0
 public void ApplyTo(IBlackboardComponent blackboard) => blackboard.SetValue <byte>(key.Index, (byte)(1 - blackboard.GetValue <byte>(key.Index)));
Пример #4
0
 public bool IsValidOn(IBlackboardComponent blackboard) => blackboard.GetValue <byte>(key.Index) == value.ToByte();
        public override void OnExecutionStart()
        {
            var targetPosition = _blackboard.GetValue <Vector3>(_targetPositionKey);

            UpdateNavMeshAgentDestination(targetPosition);
        }
Пример #6
0
 public bool IsValidOn(IBlackboardComponent blackboard) =>
 invert != (Mathf.Abs(blackboard.GetValue <float>(key.Index) - value) <= tolerance);
Пример #7
0
 public void ApplyTo(IBlackboardComponent blackboard) =>
 blackboard.SetValue <int>(key.Index, blackboard.GetValue <int>(key.Index) + blackboard.GetValue <int>(toAdd.Index));