Class LevelManager
Exposes the player progression system, including ranks, tiers, XP, unlockables, and related events.
public static class LevelManager
- Inheritance
-
LevelManager
- Inherited Members
Properties
CurrentRank
The player's current rank and tier combined.
public static FullRank CurrentRank { get; }
Property Value
Exists
Returns true when the underlying levelling manager has been instantiated.
public static bool Exists { get; }
Property Value
Rank
The player's current rank.
public static Rank Rank { get; }
Property Value
Tier
The player's current tier within their rank.
public static int Tier { get; }
Property Value
TotalXP
Total XP accumulated across all ranks.
public static int TotalXP { get; }
Property Value
XP
XP progress within the current tier.
public static int XP { get; }
Property Value
XPToNextTier
XP required to reach the next tier threshold.
public static float XPToNextTier { get; }
Property Value
Methods
AddUnlockable(Unlockable)
Registers an unlockable item for the specified rank.
public static void AddUnlockable(Unlockable unlockable)
Parameters
unlockableUnlockable
AddXP(int)
Adds XP to the player. Only works when invoked from the host/server.
public static void AddXP(int amount)
Parameters
amountintHow much XP to award.
GetFullRankForXP(int)
Converts a target XP value to the associated rank and tier.
public static FullRank GetFullRankForXP(int totalXp)
Parameters
totalXpint
Returns
GetOrderLimitMultiplier(FullRank)
Returns the order limit multiplier used by customer systems for the specified rank.
public static float GetOrderLimitMultiplier(FullRank rank)
Parameters
rankFullRank
Returns
GetTotalXPForRank(FullRank)
Gets the total XP required to reach a specific rank/tier combination.
public static int GetTotalXPForRank(FullRank rank)
Parameters
rankFullRank
Returns
GetUnlockables(FullRank)
Enumerates unlockables for the provided rank.
public static IEnumerable<Unlockable> GetUnlockables(FullRank rank)
Parameters
rankFullRank
Returns
GetXPForTier(Rank)
Gets the XP required to complete a tier for the specified rank.
public static int GetXPForTier(Rank rank)
Parameters
rankRank
Returns
Events
OnRankUp
Raised when the player's rank or tier actually increases (tier increases within a rank, or rank increases when tier exceeds 5). This only fires when the rank/tier value changes, not on every XP update. Provides the previous and new rank values.
public static event Action<FullRank, FullRank>? OnRankUp
Event Type
OnXPChanged
Raised whenever XP or rank/tier data is updated, even if the rank/tier values haven't changed. This fires on every XP change, including when only XP increases without a rank/tier change. Provides the previous and new rank values (which may be the same).
public static event Action<FullRank, FullRank>? OnXPChanged