29 lines
739 B
TypeScript
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?.();
|
|
}
|
|
}
|