Ejemplo n.º 1
0
    private void DuringSceneGUI(SceneView sceneView)
    {
        Selection.activeObject = _customCollider;

        _serializedObject.Update();
        if (_collisionPoints.arraySize > 0)
        {
            for (int i = 0; i < _collisionPoints.arraySize; i++)
            {
                SerializedProperty prop = _collisionPoints.GetArrayElementAtIndex(i);
                prop.vector3Value = Handles.PositionHandle(prop.vector3Value, Quaternion.identity);

                Handles.color = _color.colorValue;
                Handles.SphereHandleCap(-1, prop.vector3Value, Quaternion.identity, _pointRadius.floatValue, EventType.Repaint);

                Handles.Label(prop.vector3Value, "Point " + i.ToString());

                if (_collisionPoints.arraySize > 1)
                {
                    Handles.DrawDottedLine(prop.vector3Value, _collisionPoints.GetArrayElementAtIndex(_customCollider.GetNextIndex(i)).vector3Value, _screenSize);
                }
            }

            _serializedObject.ApplyModifiedProperties();
        }
    }