Add explicit YooAsset macro gates

This commit is contained in:
何冠峰
2026-05-28 11:03:28 +08:00
parent aff50317cb
commit d5a9b9f0f4
30 changed files with 37 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEditor; using UnityEditor;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using UnityEditor; using UnityEditor;
namespace YooAsset.Editor namespace YooAsset.Editor

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
namespace YooAsset.Editor namespace YooAsset.Editor

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
namespace YooAsset.Editor namespace YooAsset.Editor
{ {
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System.Collections.Generic; using System.Collections.Generic;
namespace YooAsset.Editor namespace YooAsset.Editor

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
namespace YooAsset.Editor namespace YooAsset.Editor
{ {
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
namespace YooAsset.Editor namespace YooAsset.Editor
{ {
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
namespace YooAsset.Editor namespace YooAsset.Editor
{ {
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
namespace YooAsset.Editor namespace YooAsset.Editor

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
using System.IO; using System.IO;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using UnityEditor; using UnityEditor;
namespace YooAsset.Editor namespace YooAsset.Editor

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System.Text; using System.Text;
using System.IO; using System.IO;
using System.Collections.Generic; using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using System; using System;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using UnityEngine; using UnityEngine;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
namespace YooAsset namespace YooAsset
{ {
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using UnityEngine; using UnityEngine;
namespace YooAsset namespace YooAsset

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;

View File

@@ -1,4 +1,4 @@
#if TUANJIE_1_8_OR_NEWER #if TUANJIE_1_8_OR_NEWER && YOOASSET_INSTANT_ASSET_SUPPORT
namespace YooAsset namespace YooAsset
{ {
/// <summary> /// <summary>

View File

@@ -13,17 +13,17 @@
{ {
"name": "com.tuyoogame.yooasset", "name": "com.tuyoogame.yooasset",
"expression": "", "expression": "",
"define": "YOO_ASSET_3" "define": "YOOASSET_3"
}, },
{ {
"name": "com.tuyoogame.yooasset", "name": "com.tuyoogame.yooasset",
"expression": "3.0.0-beta", "expression": "3.0.0-beta",
"define": "YOO_ASSET_3_0" "define": "YOOASSET_3_0"
}, },
{ {
"name": "com.tuyoogame.yooasset", "name": "com.tuyoogame.yooasset",
"expression": "3.0.0-beta", "expression": "3.0.0-beta",
"define": "YOO_ASSET_3_0_OR_NEWER" "define": "YOOASSET_3_0_OR_NEWER"
} }
], ],
"noEngineReferences": false "noEngineReferences": false

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
#if YOO_MACRO_SUPPORT #if YOOASSET_MACRO_SUPPORT
namespace YooAsset.Editor namespace YooAsset.Editor
{ {
/// <summary> /// <summary>
@@ -13,9 +13,9 @@ namespace YooAsset.Editor
/// </summary> /// </summary>
public static IReadOnlyList<string> Macros { get; } = new List<string>() public static IReadOnlyList<string> Macros { get; } = new List<string>()
{ {
"YOO_ASSET_3", "YOOASSET_3",
"YOO_ASSET_3_0", "YOOASSET_3_0",
"YOO_ASSET_3_0_OR_NEWER", "YOOASSET_3_0_OR_NEWER",
}; };
} }
} }

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Xml; using System.Xml;
using UnityEditor; using UnityEditor;
#if YOO_MACRO_SUPPORT #if YOOASSET_MACRO_SUPPORT
namespace YooAsset.Editor namespace YooAsset.Editor
{ {
/// <summary> /// <summary>

View File

@@ -6,7 +6,7 @@ using System.Xml;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
#if YOO_MACRO_SUPPORT #if YOOASSET_MACRO_SUPPORT
namespace YooAsset.Editor.Experiment namespace YooAsset.Editor.Experiment
{ {
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
#if UNITASK_YOOASSET_SUPPORT #if YOOASSET_UNITASK_SUPPORT
using System; using System;
using System.Collections; using System.Collections;
using System.Threading; using System.Threading;
@@ -208,7 +208,7 @@ public class TestUniTask
{ {
public IEnumerator RuntimeTester() public IEnumerator RuntimeTester()
{ {
Debug.LogWarning("UniTask tests skipped: UNITASK_YOOASSET_SUPPORT is not defined."); Debug.LogWarning("UniTask tests skipped: YOOASSET_UNITASK_SUPPORT is not defined.");
yield break; yield break;
} }
} }

View File

@@ -46,7 +46,7 @@ public class TestTask : MonoBehaviour
Project Settings --> Player --> Scripting Define Symbols Project Settings --> Player --> Scripting Define Symbols
``` ```
UNITASK_YOOASSET_SUPPORT YOOASSET_UNITASK_SUPPORT
``` ```
5. 重启Unity引擎 5. 重启Unity引擎
@@ -68,7 +68,7 @@ public class TestTask : MonoBehaviour
Project Settings --> Player --> Scripting Define Symbols Project Settings --> Player --> Scripting Define Symbols
``` ```
UNITASK_YOOASSET_SUPPORT YOOASSET_UNITASK_SUPPORT
``` ```
4. 重启Unity引擎 4. 重启Unity引擎

View File

@@ -1,4 +1,4 @@
#if UNITASK_YOOASSET_SUPPORT #if YOOASSET_UNITASK_SUPPORT
using System; using System;
using System.Threading; using System.Threading;
using YooAsset; using YooAsset;

View File

@@ -1,4 +1,4 @@
#if UNITASK_YOOASSET_SUPPORT #if YOOASSET_UNITASK_SUPPORT
#if UNITY_2020_1_OR_NEWER && ! UNITY_2021 #if UNITY_2020_1_OR_NEWER && ! UNITY_2021
#define UNITY_2020_BUG #define UNITY_2020_BUG
#endif #endif

View File

@@ -16,7 +16,7 @@
{ {
"name": "com.cysharp.unitask", "name": "com.cysharp.unitask",
"expression": "", "expression": "",
"define": "UNITASK_YOOASSET_SUPPORT" "define": "YOOASSET_UNITASK_SUPPORT"
} }
], ],
"noEngineReferences": false "noEngineReferences": false