修改灵灯系统报错

This commit is contained in:
2026-06-30 22:30:03 +08:00
parent 3c2f797f66
commit 47be10545d
6 changed files with 126 additions and 9 deletions
+3 -1
View File
@@ -4,7 +4,9 @@ using System.Collections;
namespace IndianOceanAssets.Engine2_5D
{
// Ensures the GameObject has these essential components
[RequireComponent(typeof(HealthSystem), typeof(SwordAttack), typeof(ProjectileShooter), typeof(SpiritLanternSystem))]
[RequireComponent(typeof(HealthSystem), typeof(SwordAttack))]
[RequireComponent(typeof(ProjectileShooter))]
[RequireComponent(typeof(SpiritLanternSystem))]
public class PlayerController : MonoBehaviour
{
[Header("Movement")]
@@ -55,6 +55,8 @@ public static class SpiritLanternPrefabCreator
Object.DestroyImmediate(root);
Debug.Log($"[SpiritLantern] Prefab 已创建: {prefabPath}");
EditorUtility.PingAsset(AssetDatabase.LoadMainAssetAtPath(prefabPath));
var asset = AssetDatabase.LoadMainAssetAtPath(prefabPath);
Selection.activeObject = asset;
EditorGUIUtility.PingObject(asset);
}
}