123456789101112131415161718192021222324252627282930313233 |
- using System.Collections;
- using UnityEngine;
- namespace QFramework.Example
- {
- public class ReplaceableMonoSingletonExample : MonoBehaviour
- {
-
- IEnumerator Start()
- {
-
- var instance = GameManager.Instance;
-
- new GameObject().AddComponent<GameManager>();
-
- yield return new WaitForEndOfFrame();
-
-
- Debug.Log(FindObjectsOfType<GameManager>().Length);
-
-
- Debug.Log(instance != FindObjectOfType<GameManager>());
- }
- public class GameManager : ReplaceableMonoSingleton<GameManager>
- {
- }
- }
- }
|