SDK参数控制IP内容

This commit is contained in:
yangjing 2022-10-10 16:20:54 +08:00
parent cf433f864c
commit 6e5d4407f7
5 changed files with 33 additions and 8 deletions

View File

@ -14,6 +14,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
IsDebug: 0
IsAutoLevel: 0
UseFakeMode: 0
UseDiamond: 0
JumpText: 0
IsSimpleAni: 1

View File

@ -6,10 +6,11 @@ using UnityEngine;
[CreateAssetMenu(menuName = "GameConfig")]
public class GameConfig : ConfigBase<GameConfig>
{
public bool IsFakeMode => !IsDebug && TKGSDKManager.Instance.GetConfigBool(TKGParamKey.IsFakeMode);
public bool IsFakeMode => UseFakeMode && !PlayerData.Instance.IsIPShow;
public bool IsDebug;
public bool IsAutoLevel;
public bool UseFakeMode = false;
public bool UseDiamond;
public bool JumpText = true;
public bool IsSimpleAni = true;

View File

@ -66,6 +66,13 @@ public partial class SROptions
set => PlayerData.Instance.IsMMOUser = value;
}
[Category("功能")]
public bool IP内容
{
get => PlayerData.Instance.IsIPShow;
set => PlayerData.Instance.IsIPShow = value;
}
[Category("功能")]
public bool
{

View File

@ -16,6 +16,17 @@ public class PlayerData : StorageBase<PlayerData>
}
[SerializeField] bool mIsMMOUser = false;
public bool IsIPShow
{
get => mIsIPShow;
set
{
mIsIPShow = value;
Save();
}
}
[SerializeField] bool mIsIPShow = false;
public int CurrentLevel
{
get => mCurrentLevel;
@ -203,18 +214,26 @@ public class PlayerData : StorageBase<PlayerData>
if (!GameConfig.Instance.IsDebug)
{
List<Touka.FunctionType> tFuncs = new List<Touka.FunctionType>() { Touka.FunctionType.Function_wangz };
List<Touka.FunctionType> tFuncs = new List<Touka.FunctionType>() { Touka.FunctionType.Function_wangz, Touka.FunctionType.Function_IP };
TKGSDKManager.Instance.SetFunctionSwitchListener(tFuncs, OnUserSource);
}
}
private void OnUserSource(Touka.FunctionType pFuncType, bool pOn)
{
mIsMMOUser = pOn;
Save();
switch (pFuncType)
{
case Touka.FunctionType.Function_wangz:
IsMMOUser = pOn;
Debug.Log("Usersource is mmo :" + IsMMOUser);
break;
case Touka.FunctionType.Function_IP:
IsIPShow = pOn;
Debug.Log("Usersource is IP show :" + IsIPShow);
break;
}
Debug.Log("【ToukaGame】回调func:" + pFuncType + "result:" + pOn);
Debug.Log("Usersource is mmo :" + mIsMMOUser);
}
#region card

View File

@ -15,7 +15,6 @@ public static class TKGParams
#else
{ TKGParamKey.NativeSwitch.ToString(), 0 },
#endif
{ TKGParamKey.IsFakeMode.ToString(), 0 },
#region MMO
{ TKGParamKey.Invitable.ToString(), GameConfig.Instance.IsDebug ? 1 : 0 },
@ -47,8 +46,6 @@ public enum TKGParamKey
LevelInterSwitch,
NativeSwitch,
IsFakeMode,
#region MMO
Invitable,
ShareContent,