void ShowAllPathUI()
    {
        for (int i = 0; i < eTarget.Paths.Count; i++)
        {
            PE_Path path = eTarget.Paths[i];
            if (!path.IsEditable)
            {
                continue;
            }
            EditoolsHandle.SetColor(path.PathColor);

            for (int j = 0; j < path.PathPoints.Count; j++)
            {
                path.PathPoints[j] = EditoolsHandle.PositionHandle(path.PathPoints[j], Quaternion.identity);
                EditoolsHandle.Label(path.PathPoints[j] + Vector3.up * 5, $"Point {j + 1}");
                EditoolsHandle.SetColor(Color.white);
                EditoolsHandle.DrawDottedLine(path.PathPoints[j] + Vector3.up * 5, path.PathPoints[j], .5f);
                EditoolsHandle.SetColor(path.PathColor);
                EditoolsHandle.DrawSolidDisc(path.PathPoints[j], Vector3.up, 0.1f);
                if (j < path.PathPoints.Count - 1)
                {
                    EditoolsHandle.DrawLine(path.PathPoints[j], path.PathPoints[j + 1]);
                }
            }
        }
    }
예제 #2
0
        private void ShowAllPathScene()
        {
            if (PathPoints.Count < 1)
            {
                return;
            }
            EditoolsHandle.SetColor(PathColor);

            for (int j = 0; j < Path.PathPoints.Count; j++)
            {
                Path.PathPoints[j] = EditoolsHandle.PositionHandle(Path.PathPoints[j], Quaternion.identity);
                EditoolsHandle.Label(Path.PathPoints[j] + Vector3.up * 5, $"Point {j + 1}");
                EditoolsHandle.SetColor(Color.white);
                EditoolsHandle.DrawDottedLine(Path.PathPoints[j] + Vector3.up * 5, Path.PathPoints[j], .5f);
                EditoolsHandle.SetColor(PathColor);
                EditoolsHandle.DrawSolidDisc(Path.PathPoints[j], Vector3.up, 0.1f);
                if (j < Path.PathPoints.Count - 1)
                {
                    EditoolsHandle.DrawLine(Path.PathPoints[j], Path.PathPoints[j + 1]);
                }
            }

            if (GetStartPercentIndex < 0 || GetStartPercentIndex > PathPoints.Count)
            {
                return;
            }
            EditoolsHandle.DrawDottedLine(PathPoints[GetStartPercentIndex], PathPoints[GetStartPercentIndex] + Vector3.up, 1);
            EditoolsHandle.Label(PathPoints[GetStartPercentIndex] + Vector3.up, $"Spawn Mark");
        }
예제 #3
0
    public override void DrawSceneMode()
    {
        EditoolsHandle.PositionHandle(ref Position, Quaternion.identity);

        Handles.DrawWireDisc(Position, Vector3.up, Radius);
        for (int i = 0; i < AgentNumber; i++)
        {
            Handles.CubeHandleCap(i, GetRadiusPosition(i, AgentNumber, Radius, Position), Quaternion.identity, .1f, EventType.Repaint);
        }
    }
예제 #4
0
    public override void DrawSceneMode()
    {
        EditoolsHandle.PositionHandle(ref Position, Quaternion.identity);
        EditoolsHandle.PositionHandle(ref EndPosition, Quaternion.identity);

        Handles.DrawLine(Position, EndPosition);

        for (int i = 0; i < AgentNumber; i++)
        {
            Handles.CubeHandleCap(i, GetPositionOnLine(i, AgentNumber, Position, EndPosition), Quaternion.identity, .1f, EventType.Repaint);
        }
    }
예제 #5
0
 void DrawDetectionScene()
 {
     EditoolsHandle.SetColor(Color.magenta);
     EditoolsHandle.DrawWireDisc(eTarget.LastPos, Vector3.up, eTarget.Radius);
     EditoolsHandle.SetColor(Color.green);
     EditoolsHandle.DrawWireCube(eTarget.TargetPos + Vector3.up, Vector3.one * 0.5f);
     EditoolsHandle.DrawDottedLine(eTarget.TargetPos, eTarget.TargetPos + Vector3.up * 2, 1);
     EditoolsHandle.DrawDottedLine(eTarget.TargetPos, eTarget.transform.position, 1);
     EditoolsHandle.SetColor(Color.yellow);
     EditoolsHandle.DrawWireCube(eTarget.SearchPos + Vector3.up * 2, Vector3.one * 0.5f);
     EditoolsHandle.DrawDottedLine(eTarget.SearchPos, eTarget.SearchPos + Vector3.up * 2, 1);
     EditoolsHandle.DrawDottedLine(eTarget.SearchPos, eTarget.transform.position, 1);
 }
예제 #6
0
        void DrawSegmentFeedbackOnScene()
        {
            Vector3 _currentPosition = Vector3.zero;

            for (int i = 0; i < Curve.Anchor.Count; i++)
            {
                if (i % 3 != 0)
                {
                    continue;
                }
                _currentPosition = Curve.Anchor[i];
                EditoolsHandle.DrawDottedLine(_currentPosition, _currentPosition + Vector3.up * 1.5f, 1);
                EditoolsHandle.Label(_currentPosition + Vector3.up * 1.5f, $"Segment : {i / 3}");
            }
        }
예제 #7
0
        private void DrawCurveOnScene()
        {
            EditoolsHandle.SetColor(PathColor);

            Vector3 _currentPosition = Vector3.zero;

            for (int i = 0; i < Curve.CurvePoints.Length; i++)
            {
                _currentPosition = Curve.CurvePoints[i];
                if (i < Curve.CurvePoints.Length - 1)
                {
                    Handles.DrawLine(_currentPosition, Curve.CurvePoints[i + 1]);
                }
            }
            EditoolsHandle.SetColor(Color.white);
        }
예제 #8
0
    void DrawSpawnPointScene()
    {
        for (int i = 0; i < eTarget.SpawnPoints.Count; i++)
        {
            SM_SpawnPoint _point = eTarget.SpawnPoints[i];

            EditoolsHandle.SetColor(Color.green);
            EditoolsHandle.DrawWireCube(_point.Position, _point.Size);
            EditoolsHandle.SetColor(Color.white);

            EditoolsHandle.PositionHandle(ref _point.Position, Quaternion.identity);
            EditoolsHandle.ScaleHandle(ref _point.Size, _point.Position, Quaternion.identity, 2);
            EditoolsLayout.Space();

            GetModeScene(_point);
        }
    }
예제 #9
0
    public override void DrawSceneMode()
    {
        EditoolsHandle.PositionHandle(ref Position, Quaternion.identity);

        Handles.CubeHandleCap(1, Position, Quaternion.identity, .1f, EventType.Repaint);
    }
예제 #10
0
        public override void DrawSceneMode()
        {
            if (!IsValid || Curve.IsEmpty)
            {
                return;
            }
            Curve.SetCurve();

            for (int j = 0; j < Curve.Anchor.Count; j += 3)
            {
                Vector3 _handleA = Curve.Anchor[j];
                Vector3 _handleB = Curve.Anchor[j + 1];
                Vector3 _handleC = Curve.Anchor[j + 2];


                // markers
                Handles.DrawLine(_handleA, _handleA + Vector3.up * .5f);
                Handles.DrawLine(_handleB, _handleB + Vector3.up * .5f);
                Handles.DrawLine(_handleC, _handleC + Vector3.up * .5f);

                float _sizeA = HandleUtility.GetHandleSize(_handleA);
                float _sizeB = HandleUtility.GetHandleSize(_handleB);
                float _sizeC = HandleUtility.GetHandleSize(_handleC);

                // select Handle
                bool _pressA = Handles.Button(_handleA + Vector3.up * .05f, Quaternion.identity, .05f * _sizeA,
                                              .05f * _sizeA, Handles.DotHandleCap);
                bool _pressB = Handles.Button(_handleB + Vector3.up * .05f, Quaternion.identity, .05f * _sizeB,
                                              .05f * _sizeB, Handles.DotHandleCap);
                bool _pressC = Handles.Button(_handleC + Vector3.up * .05f, Quaternion.identity, .05f * _sizeC,
                                              .05f * _sizeC, Handles.DotHandleCap);

                if (_pressA)
                {
                    selectedIndex = j;
                }
                if (_pressB)
                {
                    selectedIndex = j + 1;
                }
                if (_pressC)
                {
                    selectedIndex = j + 2;
                }

                if (selectedIndex == j) // if select first point segment
                {
                    _handleA = Handles.PositionHandle(_handleA, Quaternion.identity);
                }


                if (selectedIndex == j + 1) // if select middle segment curve
                {
                    _handleB = Handles.PositionHandle(_handleB, Quaternion.identity);
                }

                if (selectedIndex == j + 2) // if select last segment curve
                {
                    _handleC = Handles.PositionHandle(_handleC, Quaternion.identity);
                }

                Curve.Anchor[j]     = _handleA;
                Curve.Anchor[j + 1] = _handleB;
                Curve.Anchor[j + 2] = _handleC;

                // draw linked middle point
                EditoolsHandle.DrawDottedLine(_handleA, _handleB, .5f);
                EditoolsHandle.DrawDottedLine(_handleB, _handleC, .5f);
            }

            // draw curve
            DrawCurveOnScene();

            // Draw Segment feedback
            DrawSegmentFeedbackOnScene();

            EditoolsHandle.DrawDottedLine(Curve.CurvePoints[Curve.GetStartPercentIndex], Curve.CurvePoints[Curve.GetStartPercentIndex] + Vector3.up * 2, 1);
            EditoolsHandle.Label(Curve.CurvePoints[Curve.GetStartPercentIndex] + Vector3.up * 2, $"Spawn Mark");
        }