//============================== Unity Events ============================== void Awake() { ParallelPhysicsController2D pSettings = FindObjectOfType <ParallelPhysicsController2D>(); if (pSettings == null) { return; } pSettings.InitIfNecessary(); parallelFixedUpdates = GetComponents <IParallelFixedUpdate>(); parallelCollisions = GetComponents <IParallelCollision2D>(); parallelTriggers = GetComponents <IParallelTrigger2D>(); pTransform.ImportFromUnity(); colliders = GetComponentsInChildren <ParallelCollider2D>(); _body2D = Parallel2D.AddBody( (int)bodyType, (Fix64Vec2)pTransform.position, pTransform.rotation.GetZAngle(), linearDampling, angularDamping, fixedRotation, gravityScale, this); _bodyID = _body2D.BodyID; foreach (ParallelCollider2D collider in colliders) { collider.SetRootGameObject(gameObject); PShape2D shape = collider.CreateShape(gameObject); if (shape == null) { Debug.LogError("Failed to create collider shape"); continue; } PFixture2D fixture2D = Parallel2D.AddFixture(_body2D, shape, (Fix64)1); collider.ReceiveFixture(fixture2D); } }