Пример #1
0
    private void InsertTouchArea(int i, EInsertType type, ECompositeType compositeType = ECompositeType.COMBINE)
    {
        switch (type)
        {
        case EInsertType.EMPTY:
            InsertTouchArea(i, null, compositeType);
            break;

        case EInsertType.BOX:
            InsertTouchArea <BoxCollider2D>(i, "Box Area", compositeType);
            break;

        case EInsertType.CAPSULE:
            InsertTouchArea <CapsuleCollider2D>(i, "Capsule Area", compositeType);
            break;

        case EInsertType.CIRCLE:
            InsertTouchArea <CircleCollider2D>(i, "Circle Area", compositeType);
            break;

        case EInsertType.POLYGON:
            InsertTouchArea <PolygonCollider2D>(i, "Polygon Area", compositeType);
            break;
        }
    }
Пример #2
0
    private MenuFunction CreateInsertTouchAreaCallBack(int i, EInsertType type)
    {
        return(() =>
        {
            serializedObject.Update();

            InsertTouchArea(i, type);

            serializedObject.ApplyModifiedProperties();
        });
    }