#pragma warning restore 0649 public override void Visualize(SearchingArea searchingArea, DetectionArea detectionArea) { #if UNITY_EDITOR Debug.DrawLine(searchingArea.Socket.position + searchingArea.Data.Offset, detectionArea.transform.position, _lineColor, _lineLifetime); #endif }
public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea) { Vector3 positionWithOffset = searchingArea.Socket.position + searchingArea.Data.Offset; Vector3 vectorSubtraction = detectionArea.transform.position - positionWithOffset; return(!(Physics.Raycast(positionWithOffset, vectorSubtraction.normalized, vectorSubtraction.magnitude, searchingArea.Data.ObstacleMask))); }
public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea) { Vector3 forwardRotation = Quaternion.Euler(searchingArea.Data.Rotation) * searchingArea.Socket.forward; Vector3 positionWithOffset = searchingArea.Socket.position + searchingArea.Data.Offset; Vector3 vectorSubtraction = detectionArea.transform.position - positionWithOffset; return(!((searchingArea.Data.Angle != 360) && (Vector2.Angle(new Vector2(vectorSubtraction.x, vectorSubtraction.z), new Vector2(forwardRotation.x, forwardRotation.z)) > searchingArea.Data.Angle / 2))); }
public override void Visuzlize(SearchingArea searchingArea) { Vector3 positionWithOffset = searchingArea.Socket.position + searchingArea.Data.Offset; UnityEditor.Handles.color = _lineColor; UnityEditor.Handles.DrawWireArc(positionWithOffset, Vector3.up, Vector3.forward, 360.0f, searchingArea.Data.Radius); if (searchingArea.Data.Angle != 360.0f) { UnityEditor.Handles.DrawLine(positionWithOffset, positionWithOffset + LazyBot.Utility.Data.FloatHelper.DirFromAngleY( -searchingArea.Data.Angle / 2, searchingArea.transform.eulerAngles.y, searchingArea.Data.Rotation.y, false) * searchingArea.Data.Radius); UnityEditor.Handles.DrawLine(positionWithOffset, positionWithOffset + LazyBot.Utility.Data.FloatHelper.DirFromAngleY( searchingArea.Data.Angle / 2, searchingArea.transform.eulerAngles.y, searchingArea.Data.Rotation.y, false) * searchingArea.Data.Radius); } }
public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea) { return(!((detectionArea.State == LazyBot.Area.Data.HitAreaState.Disabled) || (detectionArea.State == LazyBot.Area.Data.HitAreaState.Unknown))); }
public abstract void Visuzlize(SearchingArea searchingArea);
public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea) { Vector3 positionWithOffset = searchingArea.Socket.position + searchingArea.Data.Offset; return(!((detectionArea.transform.position - positionWithOffset).magnitude > searchingArea.Data.Radius)); }
public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea) { return(!(((1 << detectionArea.Collider.gameObject.layer) & searchingArea.Data.TargetMask) == 0)); }