fix: 修复条件编译和资源系统变更导致的代码问题

This commit is contained in:
2026-03-12 17:46:51 +08:00
parent d44452d3ce
commit ee6fcc7aff
5 changed files with 19 additions and 17 deletions
@@ -1,8 +1,10 @@
using UnityEditor;
using UnityEngine;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;
using UnityEngine.Localization.Tables;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace AibisDream.Framework
{
@@ -2,8 +2,10 @@
using System.Collections.Generic;
using AibisDream.Kit;
using AibisDream.Utility;
using UnityEditor;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace AibisDream
{
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using AibisDream.Utility;
using UnityEngine;
using UnityEngine.Rendering;
@@ -489,11 +489,11 @@ namespace AibisDream
{
// 尝试获取 prefab 的 addressable key
var prefabSource = UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(_visualInstance);
if (prefabSource != null && ResourceKit.GetAssetAddressableKey(prefabSource, out string prefabPath))
{
Debug.Log($"SaveShape prefabPath: {prefabPath}");
_blockShapeData.prefabPath = prefabPath;
}
// if (prefabSource != null && EditorKit.GetAssetAddressableKey(prefabSource, out string prefabPath))
// {
// Debug.Log($"SaveShape prefabPath: {prefabPath}");
// _blockShapeData.prefabPath = prefabPath;
// }
}
BlockPuzzleKit.SaveBlockShapeData(_blockShapeData, _blockShapeData.shapeName);
+2
View File
@@ -9,7 +9,9 @@ using Unity.VisualScripting;
using UnityEngine;
using Object = UnityEngine.Object;
using System.Globalization;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace AibisDream.Utility
{
+4 -8
View File
@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using UnityEngine;
namespace AibisDream.Utility
@@ -46,14 +46,12 @@ namespace AibisDream.Utility
#region
public const string CutLinePrefabName = "CutLine";
public const string CutLinePrefabName = "Prefab/CutLine";
public const string TaskItemName = "Task Item Temp";
public const string TaskItemName = "Prefab/TaskItem";
public const string GearFollowerPrefabName = "GearFollower";
public const string ScreenTextName = "Screen Text";
public const string ActorPrefabName = "ActorAnima";
public const string SpriteActorPrefabName = "SpriteActor";
public const string ActorAnimaExPrefabName = "ActorAnimaEx";
@@ -62,12 +60,10 @@ namespace AibisDream.Utility
public const string MobileSprite = "SpriteMobileObject";
public const string MobileObject = "PrefabMobileObject";
public const string BubblePrefab = "NormalBubble";
public const string BubblePrefab = "Prefab/NormalBubble";
public const string PipelinePrefabAddress = "PipelinePrefab";
public const string RecordPrefab = "RecordItem";
public const string BlockShapePrefab = "BlockPuzzle/BlockShape";
#endregion