public Color GetTileSpriteColor(IntVector2 tilePos) { List <int> behaviors = GetTileBehaviors(tilePos); Color result = tiles[tilePos.X, tilePos.Y].GetSpriteColor(); int behaviorPriority = int.MaxValue; foreach (int id in behaviors) { TileBehavior b = _scene.GetGameObjectPool().GetTileBehavior(id); if (b.GetPriority() < behaviorPriority && b.GetSpriteColor() != null) { behaviorPriority = b.GetPriority(); result = b.GetSpriteColor(); } } return(result); }