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