Exemplo n.º 1
0
    protected virtual void OnSceneGUI()
    {
        MapClearArea vmMapClearArea = (MapClearArea)target;

        if (vmMapClearArea.mapLocalPositions.Count < 1)
        {
            return;
        }

        if (vmMapClearArea.DisplayHandles)
        {
            Undo.RecordObject(vmMapClearArea, "Clear Area points change");
            for (int i = 0; i < vmMapClearArea.mapLocalPositions.Count - 1; i++)
            {
                Vector3 newTargetPosition = Handles.PositionHandle(vmMapClearArea.transform.TransformPoint(vmMapClearArea.mapLocalPositions[i]), Quaternion.identity);
                vmMapClearArea.mapLocalPositions[i] = vmMapClearArea.transform.InverseTransformPoint(newTargetPosition);
            }
            Vector3 lastPoint = Handles.PositionHandle(vmMapClearArea.transform.TransformPoint(vmMapClearArea.mapLocalPositions[vmMapClearArea.mapLocalPositions.Count - 1]), Quaternion.identity);
            vmMapClearArea.mapLocalPositions[vmMapClearArea.mapLocalPositions.Count - 1] = vmMapClearArea.transform.InverseTransformPoint(lastPoint);
        }
    }
Exemplo n.º 2
0
 public override void OnInspectorGUI()
 {
     DrawDefaultInspector();
     MapClearArea mapParkingSpace = (MapClearArea)target;
 }