コード例 #1
0
#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
    }
コード例 #2
0
    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)));
    }
コード例 #3
0
    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)));
    }
コード例 #4
0
    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);
        }
    }
コード例 #5
0
 public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea)
 {
     return(!((detectionArea.State == LazyBot.Area.Data.HitAreaState.Disabled) ||
              (detectionArea.State == LazyBot.Area.Data.HitAreaState.Unknown)));
 }
コード例 #6
0
 public abstract void Visuzlize(SearchingArea searchingArea);
コード例 #7
0
    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));
    }
コード例 #8
0
ファイル: MaskValidatorSO.cs プロジェクト: Seaqqull/lazy-bot
 public override bool Validate(SearchingArea searchingArea, DetectionArea detectionArea)
 {
     return(!(((1 << detectionArea.Collider.gameObject.layer) & searchingArea.Data.TargetMask) == 0));
 }