Files
Alien_Sniper/assets/scripts/framework/sdk/SdkMgr.ts
T
2026-07-15 11:38:16 +08:00

29 lines
739 B
TypeScript

import { _decorator, Component } from 'cc';
const { ccclass } = _decorator;
/**
* Integration seam for a future rewarded-placement provider.
* The project currently ships without any advertising or platform SDK.
*/
export interface RewardProvider {
requestReward(onGranted: () => void): void;
}
@ccclass('SdkMgr')
export class SdkMgr extends Component implements RewardProvider {
static instance: SdkMgr;
protected onLoad(): void {
SdkMgr.instance = this;
}
/**
* SDK-free default: grant the gameplay reward immediately.
* Replace this method body with a provider call when an SDK is added later.
*/
public requestReward(onGranted?: () => void): void {
onGranted?.();
}
}