private static IRoutineWorker GetPermanentWorker() { if (!_routinePermanentWorker || !_routinePermanentWorker.gameObject) { _routinePermanentWorker = GameObjectFactory.New() .SetName("[ROUTINE] PERMANENT WORKER") .AddComponent <RoutineWorker>() .Build <RoutineWorker>(); Object.DontDestroyOnLoad(_routinePermanentWorker.gameObject); _routinePermanentWorker.gameObject.hideFlags = HideFlags.HideInHierarchy; Logger.Log("Permanent worker was created"); } return(_routinePermanentWorker); }
private static IRoutineWorker GetSceneWorker() { if (!_routineSceneWorker || !_routineSceneWorker.gameObject) { _routineSceneWorker = GameObjectFactory.New() .SetName("[ROUTINE] SCENE WORKER") .AddComponent <RoutineWorker>() .Build <RoutineWorker>(); var message = RichTextFactory.UnstyledText("Scene worker was created on scene: ") .Default.Bold.Text(SceneManager.GetActiveScene().name).ToString(true); _routineSceneWorker.gameObject.hideFlags = HideFlags.HideInHierarchy; Logger.Log(message); } return(_routineSceneWorker); }