Customization Guide
Learn how to customize the SDK behavior and integrate it with your UI
Settings ConfigurationEvent HandlingUI Integration
Customization Options
Settings Panel
Configure behavior and appearance through settings
Event Handling
Customize how your UI responds to data changes
UI Integration
Integrate the SDK with your existing UI components
Settings Configuration
Rankora Settings Panel
Access all configuration options through the Unity menu
Access Settings
- 1. In Unity, go to Rankora API → Open Settings
- 2. This opens the RankoraSettings ScriptableObject
- 3. All changes are saved automatically
Available Sections
- • API Configuration: API key and settings
- • Leaderboard Settings: Page size, sorting, etc.
- • UI Text Strings: Customizable text
- • Player ID Storage: How player IDs are saved
Quick Customization Tips
- • Page Size: Adjust how many entries show per page (5-50)
- • Sorting Order: Choose ascending or descending score display
- • Score Format: Integer, Float, or Time display
- • Custom Text: Modify loading, error, and empty state messages
Event Handling & Customization
Note: The SDK provides events for data changes, but you'll need to create your own UI components to display the data. Use the events to update your UI when data changes.
SDK Events
Events you can subscribe to for custom behavior
Player Events
OnPlayerFetched
- Player data loadedOnPostPlayerUpdated
- Player data updatedOnPlayerIdUpdated
- Player ID changedOnPlayerRankUpdated
- Player rank changedOnPlayerDeleted
- Player was deleted
Leaderboard Events
OnEntriesFetched
- Leaderboard data loadedOnLeaderboardMetadataFetched
- Metadata loadedOnError
- Global error events
UI Integration
Basic UI Integration
How to integrate the SDK with your existing UI
The SDK is designed to work with any UI system. Here's how to integrate it:
Basic UI Integrationcsharp
public class LeaderboardUI : MonoBehaviour
{
[Header("UI Elements")]
[SerializeField] private Transform entriesContainer;
[SerializeField] private TextMeshProUGUI messageText;
[SerializeField] private GameObject loadingSpinner;
[Header("Entry Prefab")]
public GameObject entryPrefab; // Your custom entry prefab
void Start() {
// Listen for leaderboard updates
RankoraLeaderboard.Instance.OnEntriesUpdated.Subscribe(entries => {
UpdateLeaderboardUI(entries);
});
// Listen for errors
RankoraLeaderboard.Instance.OnError.Subscribe(error => {
ShowMessage(error);
});
// Fetch initial data
RankoraLeaderboard.Instance.GetCurrentPage();
}
private void UpdateLeaderboardUI(List<LeaderboardEntry> entries) {
// Clear existing entries
foreach (Transform child in entriesContainer) {
Destroy(child.gameObject);
}
// Create new entry UIs
foreach (var entry in entries) {
var entryUI = Instantiate(entryPrefab, entriesContainer);
// Configure your entry UI component here
ConfigureEntryUI(entryUI, entry);
}
}
private void ConfigureEntryUI(GameObject entryUI, LeaderboardEntry entry) {
// Set up your entry UI with the entry data
// This depends on your UI component structure
}
private void ShowMessage(string message) {
messageText.text = message;
messageText.gameObject.SetActive(!string.IsNullOrEmpty(message));
}
}
Advanced UI Patterns
Best practices for building robust leaderboard UIs
Advanced patterns for building production-ready leaderboard UIs:
Best Practices:
- • Use object pooling for entry UIs
- • Implement loading states and error handling
- • Add pagination controls
- • Handle offline scenarios gracefully
- • Use Canvas Groups for smooth transitions
Common Customizations
Visual Themes
How to create consistent visual themes for your leaderboards
Theme Components
Create consistent themes by defining these visual elements:
- • Color schemes for different rank positions
- • Typography and font choices
- • Background and border styles
- • Icon and decoration elements
Implementation
- • Create theme ScriptableObjects
- • Apply themes in your UI components
- • Use events to trigger theme changes
- • Store theme preferences in PlayerPrefs
What's Next?
Ready for Advanced Features?
Explore the full API and advanced capabilities
Back to Basics
Return to the quick start guide