fix:1、修复bug
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
<linker>
|
||||
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.TextAsset" preserve="all" />
|
||||
</assembly>
|
||||
</linker>
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 796bb1165da86824ca3f53d1b1005e20
|
||||
guid: 79c31e8565590ac419eabb9381c360af
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfbaddc877b6fb14396b53751ad7c1c1
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -30,6 +30,7 @@ namespace IgnoreOPS
|
||||
public int rewardinsertion;
|
||||
public int exchangeCD = 120;
|
||||
public int PayRate;
|
||||
public int non;
|
||||
|
||||
public int AddDiscountLevel;
|
||||
public int AddDiscountCD;
|
||||
|
||||
@@ -517,7 +517,7 @@ namespace BallKingdomCrush
|
||||
try
|
||||
{
|
||||
countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;
|
||||
Debug.Log("国家代码: " + countryCode); // 例如:US, CN, JP, DE 等
|
||||
// Debug.Log("国家代码: " + countryCode); // 例如:US, CN, JP, DE 等
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
|
||||
@@ -144,6 +144,7 @@ namespace BallKingdomCrush
|
||||
private void openWB(object obj) {
|
||||
SdkConfigMgr.Instance.Open();
|
||||
CreatAnimalCard.instance.SetCameraVisible(false);
|
||||
CameraManager.Instance.SetMainCameraBackgroundTransparent();
|
||||
if (UIManager.Instance.IsExistUI(UIConst.RainPlayUI)) {
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open, false);
|
||||
} else {
|
||||
|
||||
+42416
-42413
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><resources><string name="com.crashlytics.android.build_id" translatable="false">120df273-b302-4553-adff-4fad18c4d418</string></resources>
|
||||
<?xml version="1.0" encoding="utf-8"?><resources><string name="com.crashlytics.android.build_id" translatable="false">7ee01aac-7ff8-45e0-af00-e878e21c22e1</string></resources>
|
||||
|
||||
@@ -704,7 +704,7 @@ Transform:
|
||||
m_GameObject: {fileID: 275783129}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0.2556, y: -34.4, z: 401}
|
||||
m_LocalPosition: {x: -0.2556, y: -34.4, z: 399}
|
||||
m_LocalScale: {x: 5.2, y: 5.2, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace BallKingdomCrush
|
||||
#region Field
|
||||
|
||||
#if GAME_RELEASE
|
||||
public static bool IsEnabledEngineLog = true;
|
||||
public static bool IsEnabledEngineLog = false;
|
||||
#else
|
||||
public static bool IsEnabledEngineLog = true;
|
||||
#endif
|
||||
|
||||
@@ -1,148 +1,157 @@
|
||||
using FairyGUI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public sealed class CameraManager : BaseInterfaceManager<CameraManager>
|
||||
{
|
||||
public Transform mainCameraRoot;
|
||||
public GameObject mainCameraGo;
|
||||
public Camera mainCamera;
|
||||
|
||||
public Transform fguiCameraRoot;
|
||||
public GameObject fguiCameraGo;
|
||||
public Camera fguiCamera;
|
||||
|
||||
|
||||
public bool isEnabledWorldRaycast;
|
||||
public Physics2DRaycaster physics2DRaycaster;
|
||||
public PhysicsRaycaster physics3DRaycaster;
|
||||
|
||||
private bool isMainCameraShakeing;
|
||||
|
||||
#region Coordinate
|
||||
|
||||
public Vector2 WorldPosToFGUIPos(Vector3 worldPos)
|
||||
{
|
||||
Vector3 screenPos = mainCamera.WorldToScreenPoint(worldPos);
|
||||
|
||||
screenPos.y = ScreenConst.CurrResolution.y - screenPos.y;
|
||||
Vector2 pt = GRoot.inst.GlobalToLocal(screenPos);
|
||||
return pt;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Func
|
||||
|
||||
public void SetWorldRaycasterEnabled(bool enabled)
|
||||
{
|
||||
isEnabledWorldRaycast = enabled;
|
||||
if (physics2DRaycaster != null)
|
||||
{
|
||||
EventKit.Set2DRaycasterEnabled(physics2DRaycaster, isEnabledWorldRaycast);
|
||||
}
|
||||
|
||||
if (physics3DRaycaster != null)
|
||||
{
|
||||
EventKit.Set3DRaycasterEnabled(physics3DRaycaster, isEnabledWorldRaycast);
|
||||
}
|
||||
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.WorldRaycast_EnableChange, isEnabledWorldRaycast);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Camera
|
||||
|
||||
public void CreateMainCamera()
|
||||
{
|
||||
if (mainCamera) return;
|
||||
|
||||
string name = "MainCamera";
|
||||
mainCameraGo = new GameObject(name);
|
||||
mainCameraGo.tag = name;
|
||||
mainCameraGo.layer = LayerMaskConst.Default;
|
||||
mainCameraGo.transform.localPosition = Vector3.zero;
|
||||
int cullingMask = LayerMask.GetMask(LayerMaskConst.Default_Name);
|
||||
mainCamera = CreateCamera(mainCameraGo, cullingMask: cullingMask);
|
||||
mainCamera.clearFlags = CameraClearFlags.SolidColor;
|
||||
|
||||
mainCamera.forceIntoRenderTexture = false;
|
||||
|
||||
GameObject root = new GameObject(name + "Root");
|
||||
root.transform.position = CameraConst.MainCameraPos;
|
||||
root.SetParent(AppObjConst.CameraGo);
|
||||
mainCameraGo.SetParent(root);
|
||||
mainCameraRoot = root.transform;
|
||||
|
||||
CameraAdaptive adaptiveCom = mainCamera.gameObject.AddComponent<CameraAdaptive>();
|
||||
adaptiveCom.DoAdaptive(isOrthographic: true, orthographicSize: ScreenConst.OrthographicSize_1280H);
|
||||
}
|
||||
|
||||
public void CreateFGUICamera()
|
||||
{
|
||||
if (fguiCamera) return;
|
||||
|
||||
StageCamera.CheckMainCamera();
|
||||
fguiCamera = StageCamera.main;
|
||||
fguiCamera.depth = CameraConst.UICameraDepth;
|
||||
|
||||
fguiCamera.forceIntoRenderTexture = false;
|
||||
fguiCameraGo = fguiCamera.gameObject;
|
||||
|
||||
GameObject root = new GameObject("FGUICameraRoot");
|
||||
root.transform.position = CameraConst.UICameraPos;
|
||||
root.SetParent(AppObjConst.CameraGo);
|
||||
fguiCameraGo.SetParent(root);
|
||||
fguiCameraRoot = root.transform;
|
||||
}
|
||||
|
||||
public Camera CreateCamera(GameObject cameraGo, int cullingMask)
|
||||
{
|
||||
Camera cameraCom = cameraGo.AddComponent<Camera>();
|
||||
cameraCom.clearFlags = CameraClearFlags.Depth;
|
||||
cameraCom.backgroundColor = Color.black;
|
||||
cameraCom.cullingMask = cullingMask;
|
||||
cameraCom.nearClipPlane = -30f;
|
||||
cameraCom.farClipPlane = 30f;
|
||||
cameraCom.rect = new Rect(0, 0, 1f, 1f);
|
||||
cameraCom.depth = CameraConst.MainDepth;
|
||||
cameraCom.renderingPath = RenderingPath.UsePlayerSettings;
|
||||
cameraCom.useOcclusionCulling = false;
|
||||
cameraCom.allowHDR = false;
|
||||
cameraCom.allowMSAA = false;
|
||||
cameraCom.orthographicSize = 9.6f;
|
||||
cameraCom.forceIntoRenderTexture = false;
|
||||
return cameraCom;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mgr
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
InitCameraMgr();
|
||||
|
||||
CreateMainCamera();
|
||||
CreateFGUICamera();
|
||||
}
|
||||
|
||||
private void InitCameraMgr()
|
||||
{
|
||||
AppObjConst.CameraGo = new GameObject(AppObjConst.CameraGoName);
|
||||
AppObjConst.CameraGo.SetParent(AppObjConst.FrameGo);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
GeneralKit.Destroy(AppObjConst.CameraGo);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
using FairyGUI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public sealed class CameraManager : BaseInterfaceManager<CameraManager>
|
||||
{
|
||||
public Transform mainCameraRoot;
|
||||
public GameObject mainCameraGo;
|
||||
public Camera mainCamera;
|
||||
|
||||
public Transform fguiCameraRoot;
|
||||
public GameObject fguiCameraGo;
|
||||
public Camera fguiCamera;
|
||||
|
||||
|
||||
public bool isEnabledWorldRaycast;
|
||||
public Physics2DRaycaster physics2DRaycaster;
|
||||
public PhysicsRaycaster physics3DRaycaster;
|
||||
|
||||
private bool isMainCameraShakeing;
|
||||
|
||||
#region Coordinate
|
||||
|
||||
public Vector2 WorldPosToFGUIPos(Vector3 worldPos)
|
||||
{
|
||||
Vector3 screenPos = mainCamera.WorldToScreenPoint(worldPos);
|
||||
|
||||
screenPos.y = ScreenConst.CurrResolution.y - screenPos.y;
|
||||
Vector2 pt = GRoot.inst.GlobalToLocal(screenPos);
|
||||
return pt;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Func
|
||||
|
||||
public void SetWorldRaycasterEnabled(bool enabled)
|
||||
{
|
||||
isEnabledWorldRaycast = enabled;
|
||||
if (physics2DRaycaster != null)
|
||||
{
|
||||
EventKit.Set2DRaycasterEnabled(physics2DRaycaster, isEnabledWorldRaycast);
|
||||
}
|
||||
|
||||
if (physics3DRaycaster != null)
|
||||
{
|
||||
EventKit.Set3DRaycasterEnabled(physics3DRaycaster, isEnabledWorldRaycast);
|
||||
}
|
||||
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.WorldRaycast_EnableChange, isEnabledWorldRaycast);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Camera
|
||||
|
||||
public void CreateMainCamera()
|
||||
{
|
||||
if (mainCamera) return;
|
||||
|
||||
string name = "MainCamera";
|
||||
mainCameraGo = new GameObject(name);
|
||||
mainCameraGo.tag = name;
|
||||
mainCameraGo.layer = LayerMaskConst.Default;
|
||||
mainCameraGo.transform.localPosition = Vector3.zero;
|
||||
int cullingMask = LayerMask.GetMask(LayerMaskConst.Default_Name);
|
||||
mainCamera = CreateCamera(mainCameraGo, cullingMask: cullingMask);
|
||||
mainCamera.clearFlags = CameraClearFlags.SolidColor;
|
||||
|
||||
mainCamera.forceIntoRenderTexture = false;
|
||||
|
||||
GameObject root = new GameObject(name + "Root");
|
||||
root.transform.position = CameraConst.MainCameraPos;
|
||||
root.SetParent(AppObjConst.CameraGo);
|
||||
mainCameraGo.SetParent(root);
|
||||
mainCameraRoot = root.transform;
|
||||
|
||||
CameraAdaptive adaptiveCom = mainCamera.gameObject.AddComponent<CameraAdaptive>();
|
||||
adaptiveCom.DoAdaptive(isOrthographic: true, orthographicSize: ScreenConst.OrthographicSize_1280H);
|
||||
}
|
||||
|
||||
public void CreateFGUICamera()
|
||||
{
|
||||
if (fguiCamera) return;
|
||||
|
||||
StageCamera.CheckMainCamera();
|
||||
fguiCamera = StageCamera.main;
|
||||
fguiCamera.depth = CameraConst.UICameraDepth;
|
||||
|
||||
fguiCamera.forceIntoRenderTexture = false;
|
||||
fguiCameraGo = fguiCamera.gameObject;
|
||||
|
||||
GameObject root = new GameObject("FGUICameraRoot");
|
||||
root.transform.position = CameraConst.UICameraPos;
|
||||
root.SetParent(AppObjConst.CameraGo);
|
||||
fguiCameraGo.SetParent(root);
|
||||
fguiCameraRoot = root.transform;
|
||||
}
|
||||
|
||||
public Camera CreateCamera(GameObject cameraGo, int cullingMask)
|
||||
{
|
||||
Camera cameraCom = cameraGo.AddComponent<Camera>();
|
||||
cameraCom.clearFlags = CameraClearFlags.Depth;
|
||||
cameraCom.backgroundColor = Color.black;
|
||||
cameraCom.cullingMask = cullingMask;
|
||||
cameraCom.nearClipPlane = -30f;
|
||||
cameraCom.farClipPlane = 30f;
|
||||
cameraCom.rect = new Rect(0, 0, 1f, 1f);
|
||||
cameraCom.depth = CameraConst.MainDepth;
|
||||
cameraCom.renderingPath = RenderingPath.UsePlayerSettings;
|
||||
cameraCom.useOcclusionCulling = false;
|
||||
cameraCom.allowHDR = false;
|
||||
cameraCom.allowMSAA = false;
|
||||
cameraCom.orthographicSize = 9.6f;
|
||||
cameraCom.forceIntoRenderTexture = false;
|
||||
return cameraCom;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mgr
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
InitCameraMgr();
|
||||
|
||||
CreateMainCamera();
|
||||
CreateFGUICamera();
|
||||
}
|
||||
|
||||
private void InitCameraMgr()
|
||||
{
|
||||
AppObjConst.CameraGo = new GameObject(AppObjConst.CameraGoName);
|
||||
AppObjConst.CameraGo.SetParent(AppObjConst.FrameGo);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
GeneralKit.Destroy(AppObjConst.CameraGo);
|
||||
}
|
||||
|
||||
public void SetMainCameraBackgroundTransparent()
|
||||
{
|
||||
// if (mainCamera != null)
|
||||
// {
|
||||
// mainCamera.clearFlags = CameraClearFlags.SolidColor;
|
||||
// mainCamera.backgroundColor = new Color(0, 0, 0, 0);
|
||||
// }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+190
-190
@@ -1,191 +1,191 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class SuperApplication : SApplication
|
||||
{
|
||||
private static SuperApplication m_instance;
|
||||
|
||||
public string attribution = "organic";
|
||||
|
||||
public static SuperApplication Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_instance == null)
|
||||
{
|
||||
if (IsAppQuit)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
AppObjConst.ApplicationGo = new GameObject(AppObjConst.ApplicationGoName);
|
||||
AppObjConst.ApplicationGo.SetParent(AppObjConst.FrameGo);
|
||||
m_instance = AppObjConst.ApplicationGo.AddComponent<SuperApplication>();
|
||||
}
|
||||
|
||||
return m_instance;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
if (!PlayerPrefsKit.HasKey(PrefsKeyConst.App_isNewInstall))
|
||||
{
|
||||
PlayerPrefsKit.WriteInt(PrefsKeyConst.App_isNewInstall, 1);
|
||||
}
|
||||
|
||||
AppDispatcher.Instance.AddListener(AppMsg.AppManagerRegister,
|
||||
(obj) => { AppManagerRegister.RegisterData(); });
|
||||
}
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
base.Enable();
|
||||
|
||||
InitPlugin();
|
||||
InitAppSetting();
|
||||
|
||||
ManagerRegister.Register();
|
||||
AppManagerRegister.Register();
|
||||
ManagerRegister.RegisterData();
|
||||
|
||||
ManagerOfManager.Instance.Init();
|
||||
ModuleManager.Instance.StartUpAllModule();
|
||||
|
||||
InitSettingMode();
|
||||
StartUpGameMain();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
m_instance = null;
|
||||
}
|
||||
|
||||
#region Enable
|
||||
|
||||
private void InitPlugin()
|
||||
{
|
||||
DOTweenHelper.Init();
|
||||
}
|
||||
|
||||
private void InitAppSetting()
|
||||
{
|
||||
if (!AppConst.UseInternalSetting) return;
|
||||
|
||||
Physics.autoSimulation = true;
|
||||
Physics.autoSyncTransforms = true;
|
||||
Physics2D.simulationMode = SimulationMode2D.Script;
|
||||
Physics2D.autoSyncTransforms = true;
|
||||
Debug.unityLogger.logEnabled = AppConst.IsEnabledEngineLog;
|
||||
Debug.unityLogger.filterLogType = AppConst.EnabledFilterLogType;
|
||||
Screen.sleepTimeout = AppConst.SleepTimeoutMode;
|
||||
Application.runInBackground = AppConst.IsRunInBG;
|
||||
QualitySettings.vSyncCount = 0;
|
||||
QualitySettings.lodBias = 1;
|
||||
QualitySettings.antiAliasing = AppConst.AntiAliasing;
|
||||
Application.targetFrameRate = AppConst.LowFrameRate;
|
||||
}
|
||||
|
||||
private void StartUpGameMain()
|
||||
{
|
||||
if (!IsRestart)
|
||||
{
|
||||
GameIManager.Instance.InitialMain();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameIManager.Instance.EnterMain();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Enable
|
||||
|
||||
#region SettingMode
|
||||
|
||||
private void InitSettingMode()
|
||||
{
|
||||
if (!AppConst.UseInternalSetting) return;
|
||||
InitResolutionMode();
|
||||
InitFrameRateMode();
|
||||
}
|
||||
|
||||
private bool isHDMode;
|
||||
private bool isHFRMode;
|
||||
|
||||
private void InitResolutionMode()
|
||||
{
|
||||
isHDMode = PlayerPrefsKit.ReadBool(PrefsKeyConst.Application_isHDMode, true);
|
||||
SetResolutionMode(isHDMode);
|
||||
}
|
||||
|
||||
private void InitFrameRateMode()
|
||||
{
|
||||
isHFRMode = PlayerPrefsKit.ReadBool(PrefsKeyConst.Application_isHFRMode, true);
|
||||
SetFrameRateMode(isHFRMode);
|
||||
}
|
||||
|
||||
private void SetResolutionMode(bool isHDMode)
|
||||
{
|
||||
if (isHDMode)
|
||||
{
|
||||
ScreenConst.CurrResolution.x = ScreenConst.RawResolution.x * AppConst.HDHighViewScale;
|
||||
ScreenConst.CurrResolution.y = ScreenConst.RawResolution.y * AppConst.HDHighViewScale;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenConst.CurrResolution.x = ScreenConst.RawResolution.x * AppConst.HDLowViewScale;
|
||||
ScreenConst.CurrResolution.y = ScreenConst.RawResolution.y * AppConst.HDLowViewScale;
|
||||
}
|
||||
|
||||
SetScreenResolution(ScreenConst.CurrResolution.x, ScreenConst.CurrResolution.y, true);
|
||||
}
|
||||
|
||||
private void SetFrameRateMode(bool isHFRMode)
|
||||
{
|
||||
Application.targetFrameRate = isHFRMode ? AppConst.HighFrameRate : AppConst.LowFrameRate;
|
||||
|
||||
|
||||
QualitySettings.vSyncCount = 0;
|
||||
QualitySettings.lodBias = 1;
|
||||
}
|
||||
|
||||
private void SetScreenResolution(float width, float height, bool isFullScreen)
|
||||
{
|
||||
StartCoroutine(OnSetScreenResolution(width, height, isFullScreen));
|
||||
}
|
||||
|
||||
private IEnumerator OnSetScreenResolution(float width, float height, bool isFullScreen)
|
||||
{
|
||||
yield return YieldConst.WaitForEndOfFrame;
|
||||
var allCams = Camera.allCameras;
|
||||
if (allCams == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
foreach (var cam in allCams)
|
||||
{
|
||||
cam.enabled = false;
|
||||
}
|
||||
|
||||
Screen.SetResolution((int)width, (int)height, isFullScreen);
|
||||
Screen.fullScreen = true;
|
||||
|
||||
yield return YieldConst.WaitForEndOfFrame;
|
||||
if (allCams == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
foreach (var cam in allCams)
|
||||
{
|
||||
cam.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion SettingMode
|
||||
}
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class SuperApplication : SApplication
|
||||
{
|
||||
private static SuperApplication m_instance;
|
||||
|
||||
public string attribution = "organic";
|
||||
|
||||
public static SuperApplication Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_instance == null)
|
||||
{
|
||||
if (IsAppQuit)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
AppObjConst.ApplicationGo = new GameObject(AppObjConst.ApplicationGoName);
|
||||
AppObjConst.ApplicationGo.SetParent(AppObjConst.FrameGo);
|
||||
m_instance = AppObjConst.ApplicationGo.AddComponent<SuperApplication>();
|
||||
}
|
||||
|
||||
return m_instance;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
if (!PlayerPrefsKit.HasKey(PrefsKeyConst.App_isNewInstall))
|
||||
{
|
||||
PlayerPrefsKit.WriteInt(PrefsKeyConst.App_isNewInstall, 1);
|
||||
}
|
||||
|
||||
AppDispatcher.Instance.AddListener(AppMsg.AppManagerRegister,
|
||||
(obj) => { AppManagerRegister.RegisterData(); });
|
||||
}
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
base.Enable();
|
||||
|
||||
InitPlugin();
|
||||
InitAppSetting();
|
||||
|
||||
ManagerRegister.Register();
|
||||
AppManagerRegister.Register();
|
||||
ManagerRegister.RegisterData();
|
||||
|
||||
ManagerOfManager.Instance.Init();
|
||||
ModuleManager.Instance.StartUpAllModule();
|
||||
|
||||
InitSettingMode();
|
||||
StartUpGameMain();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
m_instance = null;
|
||||
}
|
||||
|
||||
#region Enable
|
||||
|
||||
private void InitPlugin()
|
||||
{
|
||||
DOTweenHelper.Init();
|
||||
}
|
||||
|
||||
private void InitAppSetting()
|
||||
{
|
||||
if (!AppConst.UseInternalSetting) return;
|
||||
|
||||
Physics.autoSimulation = true;
|
||||
Physics.autoSyncTransforms = true;
|
||||
Physics2D.simulationMode = SimulationMode2D.Script;
|
||||
Physics2D.autoSyncTransforms = true;
|
||||
Debug.unityLogger.logEnabled = AppConst.IsEnabledEngineLog;
|
||||
Debug.unityLogger.filterLogType = AppConst.EnabledFilterLogType;
|
||||
Screen.sleepTimeout = AppConst.SleepTimeoutMode;
|
||||
Application.runInBackground = AppConst.IsRunInBG;
|
||||
QualitySettings.vSyncCount = 0;
|
||||
QualitySettings.lodBias = 1;
|
||||
QualitySettings.antiAliasing = AppConst.AntiAliasing;
|
||||
Application.targetFrameRate = AppConst.LowFrameRate;
|
||||
}
|
||||
|
||||
private void StartUpGameMain()
|
||||
{
|
||||
if (!IsRestart)
|
||||
{
|
||||
GameIManager.Instance.InitialMain();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameIManager.Instance.EnterMain();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Enable
|
||||
|
||||
#region SettingMode
|
||||
|
||||
private void InitSettingMode()
|
||||
{
|
||||
if (!AppConst.UseInternalSetting) return;
|
||||
InitResolutionMode();
|
||||
InitFrameRateMode();
|
||||
}
|
||||
|
||||
private bool isHDMode;
|
||||
private bool isHFRMode;
|
||||
|
||||
private void InitResolutionMode()
|
||||
{
|
||||
isHDMode = PlayerPrefsKit.ReadBool(PrefsKeyConst.Application_isHDMode, true);
|
||||
SetResolutionMode(isHDMode);
|
||||
}
|
||||
|
||||
private void InitFrameRateMode()
|
||||
{
|
||||
isHFRMode = PlayerPrefsKit.ReadBool(PrefsKeyConst.Application_isHFRMode, true);
|
||||
SetFrameRateMode(isHFRMode);
|
||||
}
|
||||
|
||||
private void SetResolutionMode(bool isHDMode)
|
||||
{
|
||||
if (isHDMode)
|
||||
{
|
||||
ScreenConst.CurrResolution.x = ScreenConst.RawResolution.x * AppConst.HDHighViewScale;
|
||||
ScreenConst.CurrResolution.y = ScreenConst.RawResolution.y * AppConst.HDHighViewScale;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenConst.CurrResolution.x = ScreenConst.RawResolution.x * AppConst.HDLowViewScale;
|
||||
ScreenConst.CurrResolution.y = ScreenConst.RawResolution.y * AppConst.HDLowViewScale;
|
||||
}
|
||||
|
||||
SetScreenResolution(ScreenConst.CurrResolution.x, ScreenConst.CurrResolution.y, true);
|
||||
}
|
||||
|
||||
private void SetFrameRateMode(bool isHFRMode)
|
||||
{
|
||||
Application.targetFrameRate = isHFRMode ? AppConst.HighFrameRate : AppConst.LowFrameRate;
|
||||
|
||||
|
||||
QualitySettings.vSyncCount = 0;
|
||||
QualitySettings.lodBias = 1;
|
||||
}
|
||||
|
||||
private void SetScreenResolution(float width, float height, bool isFullScreen)
|
||||
{
|
||||
StartCoroutine(OnSetScreenResolution(width, height, isFullScreen));
|
||||
}
|
||||
|
||||
private IEnumerator OnSetScreenResolution(float width, float height, bool isFullScreen)
|
||||
{
|
||||
yield return YieldConst.WaitForEndOfFrame;
|
||||
var allCams = Camera.allCameras;
|
||||
if (allCams == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
foreach (var cam in allCams)
|
||||
{
|
||||
cam.enabled = false;
|
||||
}
|
||||
|
||||
Screen.SetResolution((int)width, (int)height, isFullScreen);
|
||||
Screen.fullScreen = true;
|
||||
|
||||
yield return YieldConst.WaitForEndOfFrame;
|
||||
if (allCams == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
foreach (var cam in allCams)
|
||||
{
|
||||
cam.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion SettingMode
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace BallKingdomCrush
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.LoadBegin); //加载开始打点
|
||||
|
||||
var loginModel = LoginKit.Instance.LoginModel;
|
||||
Log.Info("Config", $"服务器传过来的配置表:{loginModel.Setting}");
|
||||
Debug.Log($"服务器传过来的配置表:{loginModel.Setting}");
|
||||
ConfigLoader.Instance.Init(new ConfigInitOptions
|
||||
{
|
||||
Setting = loginModel.Setting,
|
||||
@@ -142,14 +142,18 @@ namespace BallKingdomCrush
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns>true:非自然 false:自然</returns>
|
||||
public static bool IsOrganic()
|
||||
private static bool IsOrganic()
|
||||
{
|
||||
bool b = false;
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && SuperApplication.Instance.attribution == "organic")
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
b = GetCommonConf().IsOrganic == 1;
|
||||
if (SuperApplication.Instance.attribution == "organic")
|
||||
{
|
||||
b = GetCommonConf().non == 1;
|
||||
}
|
||||
}
|
||||
// Debug.Log($"上传---------开关:{GetCommonConf().non}");
|
||||
|
||||
Debug.Log($"下载---------开关:{b}");
|
||||
return b;
|
||||
@@ -157,7 +161,7 @@ namespace BallKingdomCrush
|
||||
|
||||
public static string GetConfigResVersion()
|
||||
{
|
||||
return IsOrganic() ? GetCommonConf().ResVersion : GetCommonConf().ResVersion1;
|
||||
return IsOrganic() ? GetCommonConf().ResVersion1 : GetCommonConf().ResVersion;
|
||||
}
|
||||
|
||||
public static List<T> GetConfig<T>() where T : class
|
||||
@@ -167,7 +171,7 @@ namespace BallKingdomCrush
|
||||
|
||||
private static List<T> GetConfigWithOrganicFallback<T, TOrganic>() where T : class
|
||||
{
|
||||
if (!IsOrganic())
|
||||
if (IsOrganic())
|
||||
{
|
||||
var organicConfig = ConfigLoader.Instance.GetConfig<List<TOrganic>>();
|
||||
if (organicConfig != null)
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"curCountry":2,"china":{"android_version":"","ios_version":"","androidXSetting":0,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"6.5.10","ios_version":"6.4.87","androidXSetting":1,"country":2,"android_admob_app_id":"ca-app-pub-3940256099942544~3347511713","ios_admob_app_id":""}}
|
||||
{"curCountry":2,"china":{"android_version":"","ios_version":"","androidXSetting":0,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"6.5.10","ios_version":"6.4.87","androidXSetting":1,"country":2,"android_admob_app_id":"ca-app-pub-4727531460679709~6995531643","ios_admob_app_id":""}}
|
||||
@@ -1,5 +1,6 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AApplication_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003F97354_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F37cc348edc804f4cb176b63962c716e7177200_003F1a_003Fb93f31c4_003FApplication_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACameraClearFlags_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003F97354_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F37cc348edc804f4cb176b63962c716e7177200_003F58_003F4605d830_003FCameraClearFlags_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AConfigSystem_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003F97354_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F45d8d9c6e50e4d1ebc0a5d7339f0472728a00_003F4b_003F6379d388_003FConfigSystem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADateTimeOffset_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003F97354_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F84fcf9255ea045aab003a751cdb5a2f6573620_003F1e_003F6b54b81f_003FDateTimeOffset_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEnumerable_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FUsers_003F97354_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc6c8374a51994d45a37d1659d5e2b9f017ab98_003Fc5_003F9e2ca964_003FEnumerable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
||||
@@ -141,7 +141,7 @@ PlayerSettings:
|
||||
loadStoreDebugModeEnabled: 0
|
||||
visionOSBundleVersion: 1.0
|
||||
tvOSBundleVersion: 1.0
|
||||
bundleVersion: 1.0.9
|
||||
bundleVersion: 1.1.0
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
@@ -170,7 +170,7 @@ PlayerSettings:
|
||||
iPhone: 0
|
||||
tvOS: 0
|
||||
overrideDefaultApplicationIdentifier: 1
|
||||
AndroidBundleVersionCode: 9
|
||||
AndroidBundleVersionCode: 10
|
||||
AndroidMinSdkVersion: 24
|
||||
AndroidTargetSdkVersion: 36
|
||||
AndroidPreferredInstallLocation: 1
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user