You've already forked CC-Framework.Commercialization
update
This commit is contained in:
47
Assets/Runtime/ADAggregator/ADPlayer.cs
Normal file
47
Assets/Runtime/ADAggregator/ADPlayer.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Runtime.ADAggregator
|
||||
{
|
||||
public abstract class ADPlayer
|
||||
{
|
||||
/// <summary>
|
||||
/// 0 未加载 、 1 加载中、 2 加载完成
|
||||
/// </summary>
|
||||
protected int curState;
|
||||
|
||||
public string Key;
|
||||
protected ADListener adListener;
|
||||
public Action OnErrorAction;
|
||||
|
||||
public int State => curState;
|
||||
|
||||
public ADPlayer Init(string key)
|
||||
{
|
||||
this.Key = key;
|
||||
this.curState = 0;
|
||||
adListener = new ADListener();
|
||||
this.OnInit();
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool IsLoading()
|
||||
{
|
||||
return curState == 1;
|
||||
}
|
||||
|
||||
public abstract void ShowAD(Action onClose, Action<bool> onVideoComplete);
|
||||
public abstract bool IsReadly();
|
||||
public abstract void LoadAD();
|
||||
|
||||
public virtual void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主动关闭广告
|
||||
/// </summary>
|
||||
public virtual void CloseAD()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user