Esempio n. 1
0
 public void DisposePhysicsBody()
 {
     if (physicsBody != PhysicsBodyHandle.NULL)
     {
         if (collisionDetected != null)
         {
             EntityModule.RemoveCollisionCallbackReportingForEntity(this);
         }
         LosgapSystem.InvokeOnMasterAsync(() => {
             physicsBody.Dispose();
             physicsBody = PhysicsBodyHandle.NULL;
         });
     }
 }
Esempio n. 2
0
 public virtual void Dispose()
 {
     lock (InstanceMutationLock) {
         if (isDisposed)
         {
             return;
         }
         isDisposed = true;
         DisposePhysicsBody();
         EntityModule.RemoveActiveEntity(this);
         if (modelInstance != null)
         {
             modelInstance.Value.Dispose();
         }
         modelInstance = null;
         transform.Dispose();
         if (physicsShapeOffset != null)
         {
             physicsShapeOffset.Value.Dispose();
         }
     }
 }
Esempio n. 3
0
 protected Entity()
 {
     EntityModule.AddActiveEntity(this);
     transform.Write(Transform.DEFAULT_TRANSFORM);
 }