summaryrefslogtreecommitdiff
path: root/Runtime/Physics2D/Physics2DModuleRegistration.cpp
blob: cd0b9b3a0e0ac13095f4eba108e5d54912c1444f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "UnityPrefix.h"
#include "Runtime/BaseClasses/ClassRegistration.h"
#include "Runtime/Modules/ModuleRegistration.h"

#if ENABLE_2D_PHYSICS

static void RegisterPhysics2DClasses (ClassRegistrationContext& context)
{
	REGISTER_CLASS (Physics2DSettings)
	REGISTER_CLASS (Rigidbody2D)

	REGISTER_CLASS (Collider2D)
	REGISTER_CLASS (CircleCollider2D)
	REGISTER_CLASS (PolygonCollider2D)
	REGISTER_CLASS (PolygonColliderBase2D)
	#if ENABLE_SPRITECOLLIDER
	REGISTER_CLASS (SpriteCollider2D)
	#endif
	REGISTER_CLASS (BoxCollider2D)
	REGISTER_CLASS (EdgeCollider2D)

	REGISTER_CLASS (Joint2D)
	REGISTER_CLASS (SpringJoint2D)
	REGISTER_CLASS (DistanceJoint2D)
	REGISTER_CLASS (HingeJoint2D)
	REGISTER_CLASS (SliderJoint2D)

	REGISTER_CLASS (PhysicsMaterial2D)
}


#if ENABLE_MONO || UNITY_WINRT
void ExportPhysics2DBindings();

static void RegisterPhysics2DICallModule ()
{
	#if !INTERNAL_CALL_STRIPPING
	ExportPhysics2DBindings ();
	#endif
}
#endif

extern "C" EXPORT_MODULE void RegisterModule_Physics2D()
{
	ModuleRegistrationInfo info;
	info.registerClassesCallback = &RegisterPhysics2DClasses;
	#if ENABLE_MONO || UNITY_WINRT
	info.registerIcallsCallback = &RegisterPhysics2DICallModule;
	#endif
	RegisterModuleInfo(info);
}

#endif // #if ENABLE_2D_PHYSICS