private void PerformActivation() { //Vic - the other place I had a question on. IsActive = true; Collision.RemoveFromManagers(); Collision.Circles.Clear(); Collision.Polygons.Add(tilePolygonReference); Collision.AddToManagers(); SpriteInstance.CurrentChainName = "Battery"; SpriteInstance.RelativeY = (float)tilePolygonReference.Points[3].Y + (SpriteInstance.Height / 2); lightEntity.Visible = true; BubblesInstance.YToDestroyAt = this.Y + BubbleYOffsetForDestroy; Collision.Visible = false; #if DEBUG if (DebuggingVariables.ShowReplenishZoneCollision) { Collision.Visible = true; } #endif }
private void SetupSafeZoneForPurchase() { //Vic - When you get on again I'd like you to review this funtion and another. //If needed I can get on a call. // //I'm trying to swap between 2 different collision instances. //The first when the safe zone is available for purchase. This will be a circle. //The second when the safe zone has been purchased. It will use the tiled polygon. //I'm able to remove them from managers, but I don't like havinng to call remove from managers //on collision. var polygon = Collision.Polygons.FirstOrDefault(); SpriteInstance.CurrentChainName = "Geyser"; tilePolygonReference = Collision.Polygons.FirstOrDefault(); Collision.RemoveFromManagers(); Collision.Polygons.Clear(); Circle circle = new Circle(); circle.AttachTo(this, false); Collision.Circles.Add(circle); Collision.AddToManagers(); Collision.Visible = false; #if DEBUG if (DebuggingVariables.ShowReplenishZoneCollision) { Collision.Visible = true; } #endif circle.Radius = this.GeyserCollisionRadius; AdjustRelativePositionsToPolygonBottom(polygon, circle); }