public static DestroyableBase GetMoveableByEntityId(uint entityId) { DestroyableBase movable = null; _gameObjects.TryGetValue(entityId, out movable); return(movable); }
protected override void OnCollision(DestroyableBase hitEnt) { // Always remove projectile on collision. GamePool.FlagForPurge(ID); // Kill particle trail (bullet) if (WeaponBulletParticleEffect != null) { GetParticleEmitter(1).Kill(); } }
public static void AddObjectToPool(DestroyableBase gameObject) { if (_updatingPool) { _deferredInsert.Add(gameObject); } else { _gameObjects.Add(gameObject.ID, gameObject); } }
protected override void OnCollision(DestroyableBase hitEnt) { // Handle player collision with lower tunnel by changing the player location. if (hitEnt is Tunnel) { // As the only colliding tunnel is a lower tunnel, always change player position. Vec3 playerPos = Position; Position = new Vec3(playerPos.x, playerPos.y, 75); return; } // Don't let player collide with own projectiles. if (hitEnt is DefaultAmmo && !(hitEnt as DefaultAmmo).IsHostile) { return; } ProcessHit(hitEnt is Door); }
protected virtual void OnCollision(DestroyableBase hitEnt) { // Collision event was not overridden, so we can unsubscribe. UnsubscribeFromCollision(); }