105 lines
2.8 KiB
C#
105 lines
2.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace MMO
|
|
{
|
|
public class MMOInnerSDKManager : MMOSingleton<MMOInnerSDKManager>
|
|
{
|
|
public Action<string, Action<bool>> DelShowRV;
|
|
public Action<string> DelShowIV;
|
|
public Action<string, string, string> DelLogEvent;
|
|
public Func<string, string> DelGetConfig;
|
|
public Action<string> DelShare;
|
|
public Action DelOpenMoreGames;
|
|
|
|
public void ShowRV(string pAdPos, Action<bool> pDelResult)
|
|
{
|
|
DelShowRV?.Invoke(pAdPos, pDelResult);
|
|
}
|
|
|
|
public void ShowIV(string pAdPos)
|
|
{
|
|
DelShowIV?.Invoke(pAdPos);
|
|
}
|
|
|
|
public void LogEvent(string pEvent)
|
|
{
|
|
DelLogEvent?.Invoke(pEvent, "Robux", "Robux");
|
|
}
|
|
|
|
public string GetConfigString(string pKey)
|
|
{
|
|
return GetConfig(pKey);
|
|
}
|
|
|
|
public int GetConfigInt(string pKey)
|
|
{
|
|
int tVal = 0;
|
|
int.TryParse(GetConfig(pKey), out tVal);
|
|
return tVal;
|
|
}
|
|
|
|
public bool GetConfigBool(string pKey)
|
|
{
|
|
return GetConfigInt(pKey) == 1;
|
|
}
|
|
|
|
private string GetConfig(string pKey)
|
|
{
|
|
return DelGetConfig?.Invoke(pKey);
|
|
}
|
|
|
|
public void Share(string pContent)
|
|
{
|
|
DelShare?.Invoke(pContent);
|
|
}
|
|
|
|
public void OpenMoreGames()
|
|
{
|
|
DelOpenMoreGames?.Invoke();
|
|
}
|
|
|
|
#region convenient log
|
|
public void LogRobuxAction(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.RobuxAction, MMOEventKey.Redeem, pValue);
|
|
}
|
|
|
|
public void LogUserType(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.UserType, MMOEventKey.UserType, pValue);
|
|
}
|
|
|
|
public void LogUserGender(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.UserGender, MMOEventKey.Gender, pValue);
|
|
}
|
|
|
|
public void LogInviteAction(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.InviteAction, MMOEventKey.Invite, pValue);
|
|
}
|
|
|
|
public void LogInviteNum(string pKey, int pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.InviteNum, pKey, pValue.ToString());
|
|
}
|
|
|
|
public void LogResultPage(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.ResultPage, MMOEventKey.Result, pValue);
|
|
}
|
|
|
|
public void LogInstallRV(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.InstallRV, MMOEventKey.InstallRV, pValue);
|
|
}
|
|
|
|
public void LogClaimSkin(string pValue)
|
|
{
|
|
DelLogEvent?.Invoke(MMOEventID.ClaimSkin, MMOEventKey.ClaimSkin, pValue);
|
|
}
|
|
#endregion
|
|
}
|
|
} |