コード例 #1
0
        // Start is called before the first frame update
        private void Start()
        {
            SaveLoadManager.Load(out playerTrain, out player);
            sceneData = new SceneData();
            //
            playerTrain = FindObjectOfType <TrainManager>().gameObject;
            //
            mainPlayer   = playerTrain.GetComponentInChildren <MainPlayer>();
            trainManager = playerTrain.GetComponentInChildren <TrainManager>();
            trainManager.Init(sceneData);
            mainPlayer.Init();
            sceneData.TargetEnemyCount = targetEnemyCount;
            sceneData.TargetPropsCount = targetPropsCount;
            sceneData.TrainSpeed       = trainSpeed;
            sceneData.LineLength       = lineLength;
            sceneData.CurrentLevel     = currentLevel;
            sceneData.LinesCount       = linesCount;
            sceneData.Player           = player;
            worldMover.SetupMover(sceneData);
            generatorManager.Init(sceneData);
            renderManager.Init();
            triggerManager.Init(generatorManager);
            //hangar.Init(sceneData); //Commited by Danny

            weaponController.Init(sceneData);


            trainStuffAdd();
            if (skillManager != null)
            {
                skillManager.Init();
            }
            pathCounter.Init(sceneData);
            sceneData.LinesOverall = generatorManager.LevelLenght;
            GenerateFirstArea();
            sceneData.CurrentState = GameState.Start;
            //sceneData.CurrentState = GameState.Preroll;
            //sceneData.CurrentState = GameState.Wait;
            //sceneData.CurrentState = GameState.Loop;
            //SaveLoadManager.SavePlayer(playerTrain, sceneData.Player); TEMPORARY OFF.
        }