.claude/skills/unlock-condition-module/SKILL.md
UnlockConditionModule reference — composable unlock conditions using ScriptableObjects with AND/OR/NOT logic, stat/currency/upgrade/prestige/gamestate/boolean checks, reactive service layer with progress tracking. Use when implementing unlock systems, gating, or progression requirements.
npx skillsauth add punkfuncgames/tetris-clone unlock-condition-moduleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Package: com.punkfuncgames.unlock-condition | Define: PUNKFUNC_UNLOCK_CONDITION
Location: Packages/com.punkfuncgames.unlock-condition/Runtime/PunkFuncGames.UnlockCondition/
Namespace: PunkFuncGames.UnlockCondition
UnlockConditionConfig (abstract ScriptableObject):
abstract bool IsMet(IObjectResolver resolver) — check if condition is satisfiedvirtual string GetEditorDescription() — inspector preview textvirtual string GetTestResult(IObjectResolver resolver) — detailed pass/fail feedbackvirtual float GetProgress(IObjectResolver resolver) — progress 0.0-1.0ComparisonHelper (Utility/ComparisonHelper.cs):
static bool Evaluate(ComparisonOperator, BigDouble current, BigDouble target) — evaluate comparisonstatic string GetSymbol(ComparisonOperator) — get display symbol (>, <, =, >=, <=)static float CalculateProgress(ComparisonOperator, BigDouble current, BigDouble target) — calculate progressCurrencyThresholdConditionConfig — check a currency amount
CurrencyDefinition Currency, ComparisonOperator Operator, SerializableBigDouble ThresholdIWalletService from VContainer at runtimeGameTemplate/Unlock Conditions/Currency ThresholdStatRequirementConditionConfig — check a stat value
StatsDefinition Stat, ComparisonOperator Operator, SerializableBigDouble RequiredValueIStatsService from VContainer at runtimeGameTemplate/Unlock Conditions/Stat RequirementUpgradeLevelConditionConfig — check an upgrade level
string UpgradeId, ComparisonOperator Operator, int RequiredLevelIUpgradeService from VContainer at runtimeGameTemplate/Unlock Conditions/Upgrade LevelPrestigeCountConditionConfig — check prestige count
ComparisonOperator Operator, int RequiredCountIPrestigeService from VContainer at runtimeGameTemplate/Unlock Conditions/Prestige CountGameStateConditionConfig — check current game state
GameState RequiredState, bool InvertIGameStateService from VContainer at runtimeGameTemplate/Unlock Conditions/Game StateBooleanConditionConfig — check a boolean flag in save data
string Key, bool ExpectedValueISaveService from VContainer at runtimeGameTemplate/Unlock Conditions/Boolean FlagComparisonOperator enum: GreaterThan, LessThan, EqualTo, GreaterOrEqual, LessOrEqual
AndConditionConfig — ALL child conditions must be met
List<UnlockConditionConfig> ConditionsOrConditionConfig — ANY child condition must be met
List<UnlockConditionConfig> ConditionsNotConditionConfig — inverts a single child condition
UnlockConditionConfig ConditionIUnlockConditionService (Service/IUnlockConditionService.cs):
void Register(string id, UnlockConditionConfig condition) — track a conditionvoid Unregister(string id) — stop trackingbool IsUnlocked(string id) — cached evaluation resultReadOnlyReactiveProperty<bool> ObserveUnlocked(string id) — reactive unlock statefloat GetProgress(string id) — current progress 0.0-1.0void EvaluateAll() — force re-evaluation, fires events on state changesIReadOnlyList<string> GetAllIds() — all registered condition IDsIReadOnlyList<string> GetUnlockedIds() — currently unlocked IDsIReadOnlyList<string> GetLockedIds() — currently locked IDsbool IsRegistered(string id) — check if condition is trackedEvents (MessagePipe):
ConditionUnlockedEvent { string ConditionId, UnlockConditionConfig Config } — fired when condition becomes metConditionLockedEvent { string ConditionId, UnlockConditionConfig Config } — fired when condition becomes unmetInstaller: UnlockConditionInstaller.Install(builder, options) — registered in ProjectLifetimeScope
[SerializeField] private UnlockConditionConfig _unlockCondition;
private readonly IObjectResolver _resolver;
public bool IsFeatureUnlocked() => _unlockCondition.IsMet(_resolver);
public float UnlockProgress() => _unlockCondition.GetProgress(_resolver);
private readonly IUnlockConditionService _unlockService;
// Register conditions at startup
_unlockService.Register("shop_tier2", shopTier2Condition);
_unlockService.Register("prestige_shop", prestigeShopCondition);
// Check state
bool isUnlocked = _unlockService.IsUnlocked("shop_tier2");
float progress = _unlockService.GetProgress("shop_tier2");
// React to changes
_unlockService.ObserveUnlocked("shop_tier2").Subscribe(unlocked => { ... });
// Periodic evaluation (call from game loop)
_unlockService.EvaluateAll();
private readonly ISubscriber<ConditionUnlockedEvent> _onUnlocked;
_onUnlocked.Subscribe(e =>
{
Debug.Log($"Unlocked: {e.ConditionId}");
}).AddTo(_disposables);
[CreateAssetMenu(menuName = "GameTemplate/Unlock Conditions/Custom")]
public sealed class CustomConditionConfig : UnlockConditionConfig
{
[SerializeField] private int _requiredLevel;
public override bool IsMet(IObjectResolver resolver)
{
IMyService service = resolver.Resolve<IMyService>();
return service.Level >= _requiredLevel;
}
public override string GetEditorDescription() => $"Level >= {_requiredLevel}";
public override float GetProgress(IObjectResolver resolver)
{
IMyService service = resolver.Resolve<IMyService>();
return Mathf.Clamp01((float)service.Level / _requiredLevel);
}
}
AndCondition (all must be true)
+-- CurrencyThreshold: Gold >= 1000
+-- StatRequirement: TotalKills >= 50
+-- NotCondition (inverts child)
| +-- GameState = GameOver
+-- OrCondition (any must be true)
+-- UpgradeLevel: Factory Lv >= 5
+-- PrestigeCount >= 2
+-- BooleanFlag: premium_user = True
development
WalletModule reference — currency management with BigDouble support, reactive properties, caps, lifetime stats, and persistence. Use when working with currencies, wallets, or financial systems.
development
UndoModule reference — command pattern with undo/redo stacks, command merging, and reactive state. Use when implementing undo/redo, undoable actions, or command patterns.
tools
Unity UI Toolkit reference — UXML documents, USS styling, MVVM pattern (ViewModel + Presenter), custom VisualElements, responsive layout, animations, performance guidelines, and complete Figma-to-UI-Toolkit property mapping. Use when building or modifying UI with UI Toolkit, creating UXML/USS files, writing ViewModels or Presenters, designing screens/panels/components, or converting Figma designs to UI Toolkit.
content-media
UIModule reference — panel management, dialog service, notifications, loading screen, and localized UI components. Use when working with UI panels, popups, dialogs, or localized text/images.