From 6e5d4407f7030ec367741827b37f002d0b164b8d Mon Sep 17 00:00:00 2001 From: yangjing Date: Mon, 10 Oct 2022 16:20:54 +0800 Subject: [PATCH] =?UTF-8?q?SDK=E5=8F=82=E6=95=B0=E6=8E=A7=E5=88=B6IP?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Resources/Config/GameConfig.asset | 1 + Assets/Scripts/Config/GameConfig.cs | 3 ++- .../Scripts/Debug/SROptions.MergeTactics.cs | 7 +++++ Assets/Scripts/Storage/PlayerData.cs | 27 ++++++++++++++++--- Assets/TKGSDK/Config/Scripts/TKGParams.cs | 3 --- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Assets/Resources/Config/GameConfig.asset b/Assets/Resources/Config/GameConfig.asset index aeb19f3e..0d36a3a8 100644 --- a/Assets/Resources/Config/GameConfig.asset +++ b/Assets/Resources/Config/GameConfig.asset @@ -14,6 +14,7 @@ MonoBehaviour: m_EditorClassIdentifier: IsDebug: 0 IsAutoLevel: 0 + UseFakeMode: 0 UseDiamond: 0 JumpText: 0 IsSimpleAni: 1 diff --git a/Assets/Scripts/Config/GameConfig.cs b/Assets/Scripts/Config/GameConfig.cs index af1e0b3c..7dc7eea5 100644 --- a/Assets/Scripts/Config/GameConfig.cs +++ b/Assets/Scripts/Config/GameConfig.cs @@ -6,10 +6,11 @@ using UnityEngine; [CreateAssetMenu(menuName = "GameConfig")] public class GameConfig : ConfigBase { - 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; diff --git a/Assets/Scripts/Debug/SROptions.MergeTactics.cs b/Assets/Scripts/Debug/SROptions.MergeTactics.cs index 22aaf704..de4f4dd8 100644 --- a/Assets/Scripts/Debug/SROptions.MergeTactics.cs +++ b/Assets/Scripts/Debug/SROptions.MergeTactics.cs @@ -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 战力开关 { diff --git a/Assets/Scripts/Storage/PlayerData.cs b/Assets/Scripts/Storage/PlayerData.cs index e603e2a3..59fcb9a3 100644 --- a/Assets/Scripts/Storage/PlayerData.cs +++ b/Assets/Scripts/Storage/PlayerData.cs @@ -16,6 +16,17 @@ public class PlayerData : StorageBase } [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 if (!GameConfig.Instance.IsDebug) { - List tFuncs = new List() { Touka.FunctionType.Function_wangz }; + List tFuncs = new List() { 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 diff --git a/Assets/TKGSDK/Config/Scripts/TKGParams.cs b/Assets/TKGSDK/Config/Scripts/TKGParams.cs index 48cfd5f9..79184ea3 100644 --- a/Assets/TKGSDK/Config/Scripts/TKGParams.cs +++ b/Assets/TKGSDK/Config/Scripts/TKGParams.cs @@ -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,