AK056/Assets/script/lib/EasyInject/Behaviours/AcrossScenesBeanObject.cs
2025-05-07 11:20:40 +08:00

18 lines
463 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using EasyInject.Attributes;
namespace EasyInject.Behaviours
{
/// <summary>
/// author: spyn
/// description: 跨场景Bean组件用于想要作为Bean但没有自己特殊逻辑组件脚本的MonoBehavior
/// </summary>
[PersistAcrossScenes]
public class AcrossScenesBeanObject : BeanObject
{
private void Awake()
{
// 保证不被销毁
DontDestroyOnLoad(gameObject);
}
}
}