Пример #1
0
 void Start()
 {
     SmartColliderCore.TryInitialize();
     m_rigidBody   = GetComponent <Rigidbody>();
     m_rigidBody2D = GetComponent <Rigidbody2D>();
     m_prevPos     = transform.position;
 }
Пример #2
0
 /// <summary>
 /// LayerCollision will be set with default values of Layer Collision Mask.
 /// It will take the 3D or 2D settings depending on what rigid body the owner of this component have.
 /// </summary>
 public void ResetLayerCollisions()
 {
     SmartColliderCore.Initialize();
     if (GetComponent <Rigidbody>() != null)
     {
         LayerCollision = SmartColliderCore.GetCollisionLayerMask3D(gameObject.layer);
     }
     else
     {
         LayerCollision = SmartColliderCore.GetCollisionLayerMask2D(gameObject.layer);
     }
 }