@@ -1396,6 +1396,7 @@ MonoBehaviour: | |||||
appleUserIdText: {fileID: 5200266615250658360} | appleUserIdText: {fileID: 5200266615250658360} | ||||
DeleteAccountButton: {fileID: 1117439657247871432} | DeleteAccountButton: {fileID: 1117439657247871432} | ||||
LogOutButton: {fileID: 2886384592295336126} | LogOutButton: {fileID: 2886384592295336126} | ||||
SettingButton: {fileID: 3980948398050332762} | |||||
--- !u!1 &6722503920034882643 | --- !u!1 &6722503920034882643 | ||||
GameObject: | GameObject: | ||||
m_ObjectHideFlags: 0 | m_ObjectHideFlags: 0 | ||||
@@ -31,6 +31,11 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener | |||||
async void Start() | async void Start() | ||||
{ | { | ||||
if (GameConfig.platform!= RuntimePlatform.IPhonePlayer) | |||||
{ | |||||
Debug.LogWarning("非 iOS 平台,无法初始化 IAP"); | |||||
return; | |||||
} | |||||
await UnityServices.InitializeAsync(); // 初始化 UGS | await UnityServices.InitializeAsync(); // 初始化 UGS | ||||
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); | var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); | ||||
builder.AddProduct(subscriptionId, ProductType.Subscription); | builder.AddProduct(subscriptionId, ProductType.Subscription); | ||||
@@ -0,0 +1,16 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
public class GameConfig | |||||
{ | |||||
#if UNITY_ANDROID | |||||
public static RuntimePlatform platform = RuntimePlatform.Android; | |||||
#elif UNITY_IPHONE | |||||
public static RuntimePlatform platform = RuntimePlatform.IPhonePlayer; | |||||
#else | |||||
public static RuntimePlatform platform = RuntimePlatform.WebGLPlayer; | |||||
#endif | |||||
} |
@@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: f8d8ad7c45ecf8845af206bbddf3dc5d | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -4,6 +4,7 @@ using UnityEngine; | |||||
public class GameData : MonoBehaviour | public class GameData : MonoBehaviour | ||||
{ | { | ||||
public static GameData Instance { get; private set; } | public static GameData Instance { get; private set; } | ||||
//public string username = "游客"; | //public string username = "游客"; | ||||
@@ -25,3 +26,10 @@ public class GameData : MonoBehaviour | |||||
DontDestroyOnLoad(gameObject); // 场景切换不销毁 | DontDestroyOnLoad(gameObject); // 场景切换不销毁 | ||||
} | } | ||||
} | } | ||||
public enum GameDataType | |||||
{ | |||||
Username, | |||||
AppleUserId, | |||||
IsYouke | |||||
} |
@@ -7,7 +7,15 @@ public class Init : MonoBehaviour | |||||
// Start is called before the first frame update | // Start is called before the first frame update | ||||
void Start() | void Start() | ||||
{ | { | ||||
UIManager.Instance.OpenUI<UILogin>(); | |||||
if (GameConfig.platform == RuntimePlatform.WebGLPlayer) | |||||
{ | |||||
UIManager.Instance.OpenUI<UIMainMenu>(); | |||||
} | |||||
else | |||||
{ | |||||
UIManager.Instance.OpenUI<UILogin>(); | |||||
} | |||||
} | } | ||||
// Update is called once per frame | // Update is called once per frame | ||||
@@ -14,11 +14,17 @@ public class UIMainMenu : UIBase | |||||
[SerializeField] | [SerializeField] | ||||
Button LogOutButton; | Button LogOutButton; | ||||
[SerializeField] | |||||
GameObject SettingButton; | |||||
public override void OnOpen(params object[] args) | public override void OnOpen(params object[] args) | ||||
{ | { | ||||
DeleteAccountButton.onClick.AddListener(ClickDeleteAccountButton); | DeleteAccountButton.onClick.AddListener(ClickDeleteAccountButton); | ||||
LogOutButton.onClick.AddListener(ClickLogOutButton); | LogOutButton.onClick.AddListener(ClickLogOutButton); | ||||
if (GameConfig.platform == RuntimePlatform.WebGLPlayer) | |||||
{ | |||||
SettingButton.SetActive(false); | |||||
} | |||||
} | } | ||||
@@ -1 +1 @@ | |||||
Build from CHINAMI-5S19PK6 at 2025/8/5 17:18:43 | |||||
Build from CHINAMI-5S19PK6 at 2025/8/7 17:29:08 |
@@ -44,10 +44,10 @@ PlayerSettings: | |||||
m_HolographicTrackingLossScreen: {fileID: 0} | m_HolographicTrackingLossScreen: {fileID: 0} | ||||
defaultScreenWidth: 1920 | defaultScreenWidth: 1920 | ||||
defaultScreenHeight: 1080 | defaultScreenHeight: 1080 | ||||
defaultScreenWidthWeb: 960 | |||||
defaultScreenHeightWeb: 600 | |||||
defaultScreenWidthWeb: 480 | |||||
defaultScreenHeightWeb: 854 | |||||
m_StereoRenderingPath: 0 | m_StereoRenderingPath: 0 | ||||
m_ActiveColorSpace: 1 | |||||
m_ActiveColorSpace: 0 | |||||
m_MTRendering: 1 | m_MTRendering: 1 | ||||
mipStripping: 0 | mipStripping: 0 | ||||
numberOfMipsStripped: 0 | numberOfMipsStripped: 0 | ||||
@@ -155,15 +155,16 @@ PlayerSettings: | |||||
androidSupportedAspectRatio: 1 | androidSupportedAspectRatio: 1 | ||||
androidMaxAspectRatio: 2.1 | androidMaxAspectRatio: 2.1 | ||||
applicationIdentifier: | applicationIdentifier: | ||||
Android: com.sange.MosquitoKillerOutdoor | |||||
iPhone: com.sange.quwen | iPhone: com.sange.quwen | ||||
buildNumber: | buildNumber: | ||||
Standalone: 0 | Standalone: 0 | ||||
iPhone: 0 | iPhone: 0 | ||||
tvOS: 0 | tvOS: 0 | ||||
overrideDefaultApplicationIdentifier: 1 | |||||
overrideDefaultApplicationIdentifier: 0 | |||||
AndroidBundleVersionCode: 1 | AndroidBundleVersionCode: 1 | ||||
AndroidMinSdkVersion: 22 | AndroidMinSdkVersion: 22 | ||||
AndroidTargetSdkVersion: 0 | |||||
AndroidTargetSdkVersion: 28 | |||||
AndroidPreferredInstallLocation: 1 | AndroidPreferredInstallLocation: 1 | ||||
aotOptions: | aotOptions: | ||||
stripEngineCode: 1 | stripEngineCode: 1 | ||||
@@ -245,7 +246,7 @@ PlayerSettings: | |||||
useCustomBaseGradleTemplate: 0 | useCustomBaseGradleTemplate: 0 | ||||
useCustomGradlePropertiesTemplate: 0 | useCustomGradlePropertiesTemplate: 0 | ||||
useCustomProguardFile: 0 | useCustomProguardFile: 0 | ||||
AndroidTargetArchitectures: 1 | |||||
AndroidTargetArchitectures: 3 | |||||
AndroidTargetDevices: 0 | AndroidTargetDevices: 0 | ||||
AndroidSplashScreenScale: 0 | AndroidSplashScreenScale: 0 | ||||
androidSplashScreen: {fileID: 0} | androidSplashScreen: {fileID: 0} | ||||
@@ -552,6 +553,8 @@ PlayerSettings: | |||||
m_EncodingQuality: 1 | m_EncodingQuality: 1 | ||||
- m_BuildTarget: tvOS | - m_BuildTarget: tvOS | ||||
m_EncodingQuality: 1 | m_EncodingQuality: 1 | ||||
- m_BuildTarget: WebGL | |||||
m_EncodingQuality: 1 | |||||
m_BuildTargetGroupLightmapSettings: [] | m_BuildTargetGroupLightmapSettings: [] | ||||
m_BuildTargetNormalMapEncoding: | m_BuildTargetNormalMapEncoding: | ||||
- m_BuildTarget: Android | - m_BuildTarget: Android | ||||
@@ -803,7 +806,7 @@ PlayerSettings: | |||||
webGLDebugSymbols: 0 | webGLDebugSymbols: 0 | ||||
webGLEmscriptenArgs: | webGLEmscriptenArgs: | ||||
webGLModulesDirectory: | webGLModulesDirectory: | ||||
webGLTemplate: APPLICATION:Default | |||||
webGLTemplate: APPLICATION:Minimal | |||||
webGLAnalyzeBuildSize: 0 | webGLAnalyzeBuildSize: 0 | ||||
webGLUseEmbeddedResources: 0 | webGLUseEmbeddedResources: 0 | ||||
webGLCompressionFormat: 1 | webGLCompressionFormat: 1 | ||||
@@ -815,7 +818,8 @@ PlayerSettings: | |||||
scriptingDefineSymbols: {} | scriptingDefineSymbols: {} | ||||
additionalCompilerArguments: {} | additionalCompilerArguments: {} | ||||
platformArchitecture: {} | platformArchitecture: {} | ||||
scriptingBackend: {} | |||||
scriptingBackend: | |||||
Android: 1 | |||||
il2cppCompilerConfiguration: {} | il2cppCompilerConfiguration: {} | ||||
managedStrippingLevel: | managedStrippingLevel: | ||||
EmbeddedLinux: 1 | EmbeddedLinux: 1 | ||||
@@ -836,7 +840,7 @@ PlayerSettings: | |||||
allowUnsafeCode: 0 | allowUnsafeCode: 0 | ||||
useDeterministicCompilation: 1 | useDeterministicCompilation: 1 | ||||
enableRoslynAnalyzers: 1 | enableRoslynAnalyzers: 1 | ||||
selectedPlatform: 3 | |||||
selectedPlatform: 4 | |||||
additionalIl2CppArgs: | additionalIl2CppArgs: | ||||
scriptingRuntimeVersion: 1 | scriptingRuntimeVersion: 1 | ||||
gcIncremental: 1 | gcIncremental: 1 | ||||