private void Awake() { _gameScenarioBase = FindObjectOfType <GameScenarioBase>(); _gameProgress = FindObjectOfType <GameProgress>(); _nextSceneNumber = SceneManager.GetActiveScene().buildIndex + _nextLoadSceneNumber; if (_gameScenarioBase == null) { var scenario = CustomResources.Load <GameScenarioBase> (AssetsPathGameObject.GameObjects[GameObjectType.GameScenarioExecutor]); _gameScenarioBase = Instantiate(scenario); if (_gameScenarioBase == null) { CustomDebug.LogError("GameScenarioExecutor has no scenario", this); return; } } _gameScenarioBase.Inject(_gameProgress); Planner.Chain() .AddFunc(_gameScenarioBase.ExecuteScenario) .AddAction(LoadNextScene) ; }
private void Awake() { if (scenario == null) { Debug.LogError("GameScenarioExecutor has no scenario", this); return; } scenario.Inject(progress); Planner.Chain() .AddFunc(scenario.ExecuteScenario) .AddAction(LoadNextScene) ; }