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.Collections.Generic;
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;
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;
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
{
/// <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;
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
{
/// <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
{
/// <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
{
/// <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;
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.Linq;
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.IO;
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;
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.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.IO;
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 UnityEditor;
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;

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.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
{
/// <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;
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.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
{
/// <summary>

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
#if UNITASK_YOOASSET_SUPPORT
#if YOOASSET_UNITASK_SUPPORT
using System;
using System.Collections;
using System.Threading;
@@ -208,7 +208,7 @@ public class TestUniTask
{
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;
}
}

View File

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

View File

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

View File

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

View File

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