12345678910111213141516171819202122232425 |
- using UnityEngine;
- using System.Collections;
- namespace Engine.Component
- {
- /// <summary>标示某个gameobjec切换场景时不会被释放</summary>
- public class DontDestroyComponent : BaseComponent
- {
- /// <summary>初始化函数</summary>
- public override void Awake()
- {
- //gameObject切换场景时不被释放
- DontDestroyOnLoad(this.gameObject);
- base.Awake();
- }
- /// <summary>释放函数</summary>
- public override void Dispose()
- {
- base.Dispose();
- }
- }
- }
|