From 1ab047b5fdd933c38ba0519ec2e83a44512ea8d7 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 17:46:11 +0800
Subject: [PATCH] webgl代码合并 1
---
Main/Core/Platform/PlatformFactory.cs | 150 +++++++++++++++++++++++++-------------------------
1 files changed, 75 insertions(+), 75 deletions(-)
diff --git a/Main/Core/Platform/PlatformFactory.cs b/Main/Core/Platform/PlatformFactory.cs
index 3882365..db91460 100644
--- a/Main/Core/Platform/PlatformFactory.cs
+++ b/Main/Core/Platform/PlatformFactory.cs
@@ -1,85 +1,85 @@
-using UnityEngine;
+// using UnityEngine;
-/// <summary>
-/// 骞冲彴宸ュ巶绫伙紝鐢ㄤ簬鍒涘缓瀵瑰簲骞冲彴鐨勫疄鐜�
-/// </summary>
-public static class PlatformFactory
-{
- private static IPlatformService _currentPlatform;
- private static PlatformType? _forcedPlatformType;
+// /// <summary>
+// /// 骞冲彴宸ュ巶绫伙紝鐢ㄤ簬鍒涘缓瀵瑰簲骞冲彴鐨勫疄鐜�
+// /// </summary>
+// public static class PlatformFactory
+// {
+// private static IPlatformService _currentPlatform;
+// private static PlatformType? _forcedPlatformType;
- /// <summary>
- /// 鑾峰彇褰撳墠骞冲彴瀹炰緥
- /// </summary>
- public static IPlatformService GetCurrent()
- {
- if (_currentPlatform == null)
- {
- _currentPlatform = CreatePlatform();
- }
- return _currentPlatform;
- }
+// /// <summary>
+// /// 鑾峰彇褰撳墠骞冲彴瀹炰緥
+// /// </summary>
+// public static IPlatformService GetCurrent()
+// {
+// if (_currentPlatform == null)
+// {
+// _currentPlatform = CreatePlatform();
+// }
+// return _currentPlatform;
+// }
- /// <summary>
- /// 寮哄埗鎸囧畾骞冲彴绫诲瀷锛堢敤浜庢祴璇曪級
- /// </summary>
- public static void ForcePlatform(PlatformType platformType)
- {
- _forcedPlatformType = platformType;
- _currentPlatform = null; // 閲嶇疆褰撳墠骞冲彴
- }
+// /// <summary>
+// /// 寮哄埗鎸囧畾骞冲彴绫诲瀷锛堢敤浜庢祴璇曪級
+// /// </summary>
+// public static void ForcePlatform(PlatformType platformType)
+// {
+// _forcedPlatformType = platformType;
+// _currentPlatform = null; // 閲嶇疆褰撳墠骞冲彴
+// }
- /// <summary>
- /// 鍒涘缓骞冲彴瀹炰緥
- /// </summary>
- private static IPlatformService CreatePlatform()
- {
- PlatformType platformType = DetectPlatformType();
+// /// <summary>
+// /// 鍒涘缓骞冲彴瀹炰緥
+// /// </summary>
+// private static IPlatformService CreatePlatform()
+// {
+// PlatformType platformType = DetectPlatformType();
- switch (platformType)
- {
- case PlatformType.WeChat:
- Debug.Log("[PlatformFactory] 鍒涘缓寰俊灏忔父鎴忓钩鍙板疄渚�");
- return new WeChatPlatform();
+// switch (platformType)
+// {
+// case PlatformType.WeChat:
+// Debug.Log("[PlatformFactory] 鍒涘缓寰俊灏忔父鎴忓钩鍙板疄渚�");
+// return new WeChatPlatform();
- case PlatformType.Douyin:
- Debug.Log("[PlatformFactory] 鍒涘缓鎶栭煶灏忔父鎴忓钩鍙板疄渚�");
- return new DouyinPlatform();
+// case PlatformType.Douyin:
+// Debug.Log("[PlatformFactory] 鍒涘缓鎶栭煶灏忔父鎴忓钩鍙板疄渚�");
+// return new DouyinPlatform();
- case PlatformType.Vivo:
- Debug.Log("[PlatformFactory] 鍒涘缓vivo灏忔父鎴忓钩鍙板疄渚�");
- return new VivoPlatform();
+// case PlatformType.Vivo:
+// Debug.Log("[PlatformFactory] 鍒涘缓vivo灏忔父鎴忓钩鍙板疄渚�");
+// return new VivoPlatform();
- case PlatformType.Standalone:
- default:
- Debug.Log("[PlatformFactory] 鍒涘缓缂栬緫鍣ㄦ祴璇曞钩鍙板疄渚�");
- return new StandalonePlatform();
- }
- }
+// case PlatformType.Standalone:
+// default:
+// Debug.Log("[PlatformFactory] 鍒涘缓缂栬緫鍣ㄦ祴璇曞钩鍙板疄渚�");
+// return new StandalonePlatform();
+// }
+// }
- /// <summary>
- /// 妫�娴嬪綋鍓嶅钩鍙扮被鍨�
- /// </summary>
- private static PlatformType DetectPlatformType()
- {
- // 濡傛灉寮哄埗鎸囧畾浜嗗钩鍙扮被鍨嬶紝浣跨敤寮哄埗绫诲瀷
- if (_forcedPlatformType.HasValue)
- {
- Debug.Log($"[PlatformFactory] 浣跨敤寮哄埗鎸囧畾鐨勫钩鍙扮被鍨�: {_forcedPlatformType.Value}");
- return _forcedPlatformType.Value;
- }
+// /// <summary>
+// /// 妫�娴嬪綋鍓嶅钩鍙扮被鍨�
+// /// </summary>
+// private static PlatformType DetectPlatformType()
+// {
+// // 濡傛灉寮哄埗鎸囧畾浜嗗钩鍙扮被鍨嬶紝浣跨敤寮哄埗绫诲瀷
+// if (_forcedPlatformType.HasValue)
+// {
+// Debug.Log($"[PlatformFactory] 浣跨敤寮哄埗鎸囧畾鐨勫钩鍙扮被鍨�: {_forcedPlatformType.Value}");
+// return _forcedPlatformType.Value;
+// }
- #if UNITY_EDITOR
- // Unity 缂栬緫鍣ㄧ幆澧�
- return PlatformType.Standalone;
- #elif UNITY_WEBGL
- // WebGL 骞冲彴锛岄渶瑕侀�氳繃 JavaScript 妫�娴嬪叿浣撳钩鍙�
- // TODO: 閫氳繃 Application.ExternalEval 妫�娴嬪井淇°�佹姈闊崇瓑骞冲彴
- // 鏆傛椂榛樿杩斿洖寰俊
- return PlatformType.WeChat;
- #else
- // 鍏朵粬骞冲彴榛樿涓� Standalone
- return PlatformType.Standalone;
- #endif
- }
- }
+// #if UNITY_EDITOR
+// // Unity 缂栬緫鍣ㄧ幆澧�
+// return PlatformType.Standalone;
+// #elif UNITY_WEBGL
+// // WebGL 骞冲彴锛岄渶瑕侀�氳繃 JavaScript 妫�娴嬪叿浣撳钩鍙�
+// // TODO: 閫氳繃 Application.ExternalEval 妫�娴嬪井淇°�佹姈闊崇瓑骞冲彴
+// // 鏆傛椂榛樿杩斿洖寰俊
+// return PlatformType.WeChat;
+// #else
+// // 鍏朵粬骞冲彴榛樿涓� Standalone
+// return PlatformType.Standalone;
+// #endif
+// }
+// }
--
Gitblit v1.8.0