You've already forked Commercialization.topon
release: 1.4.8
This commit is contained in:
@@ -40,6 +40,8 @@ public sealed class IAAAdDebugSampleGui : MonoBehaviour
|
||||
private GUIStyle _logStyle;
|
||||
private bool _rewardedReadyCache;
|
||||
private bool _interstitialReadyCache;
|
||||
private bool _maskOpen;
|
||||
private string _lastEventLog = "<none>";
|
||||
private string _rewardedStatusCache = "Not refreshed yet.";
|
||||
private string _interstitialStatusCache = "Not refreshed yet.";
|
||||
private float _nextStatusRefreshTime;
|
||||
@@ -168,6 +170,8 @@ public sealed class IAAAdDebugSampleGui : MonoBehaviour
|
||||
RefreshStatusCaches();
|
||||
GUILayout.Label($"Rewarded Ready: {_rewardedReadyCache}", _textStyle);
|
||||
GUILayout.Label($"Interstitial Ready: {_interstitialReadyCache}", _textStyle);
|
||||
GUILayout.Label($"Mask Open: {_maskOpen}", _textStyle);
|
||||
GUILayout.Label($"Last EventLog: {_lastEventLog}", _textStyle);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -376,7 +380,17 @@ public sealed class IAAAdDebugSampleGui : MonoBehaviour
|
||||
}
|
||||
|
||||
_initInvoked = true;
|
||||
var controller = new ToponAdController();
|
||||
var controller = new SampleToponAdController(
|
||||
onMaskChanged: isOpen =>
|
||||
{
|
||||
_maskOpen = isOpen;
|
||||
AppendLog($"Mask changed => open={isOpen}");
|
||||
},
|
||||
onEventLog: (eventTable, eventValue, eventMessage) =>
|
||||
{
|
||||
_lastEventLog = $"{eventTable}:{eventValue}:{eventMessage}";
|
||||
AppendLog($"EventLog => table={eventTable}, value={eventValue}, message={eventMessage}");
|
||||
});
|
||||
ADManager.Instance.Init(() =>
|
||||
{
|
||||
_initCallbackReceived = true;
|
||||
@@ -612,4 +626,39 @@ public sealed class IAAAdDebugSampleGui : MonoBehaviour
|
||||
richText = false
|
||||
};
|
||||
}
|
||||
|
||||
private sealed class SampleToponAdController : IAdController
|
||||
{
|
||||
private readonly ToponAdController _inner = new ToponAdController();
|
||||
private readonly Action<bool> _onMaskChanged;
|
||||
private readonly Action<string, string, string> _onEventLog;
|
||||
|
||||
public SampleToponAdController(Action<bool> onMaskChanged, Action<string, string, string> onEventLog)
|
||||
{
|
||||
_onMaskChanged = onMaskChanged;
|
||||
_onEventLog = onEventLog;
|
||||
}
|
||||
|
||||
public void Init(ADConfig adConfig, object[] args)
|
||||
{
|
||||
_inner.Init(adConfig, args);
|
||||
}
|
||||
|
||||
public ADPlayer CreateAdPlayer(AD_Type type)
|
||||
{
|
||||
return _inner.CreateAdPlayer(type);
|
||||
}
|
||||
|
||||
public void EventLog(string eventTable, string eventValue, string eventMessage = null)
|
||||
{
|
||||
_onEventLog?.Invoke(eventTable, eventValue, eventMessage);
|
||||
_inner.EventLog(eventTable, eventValue, eventMessage);
|
||||
}
|
||||
|
||||
public void SetMask(bool isOpen)
|
||||
{
|
||||
_onMaskChanged?.Invoke(isOpen);
|
||||
_inner.SetMask(isOpen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user