async Task Init() { state = State.Loading; await loader.LoadWrapper(); if (state == State.Error) { return; } stopwatch.Start(); state = State.Initializing; detailedState = "Initializing sectors"; await WaitIfNecessary(); sectorManager.Init(); detailedState = "Initializing graphs"; await WaitIfNecessary(); graphManager.Init(); detailedState = "Initializing lights"; await WaitIfNecessary(); lightManager.Init(); detailedState = "Initializing persos"; await InitPersos(); sectorManager.InitLights(); detailedState = "Initializing camera"; await WaitIfNecessary(); InitCamera(); detailedState = "Initializing portals"; await WaitIfNecessary(); portalManager.Init(); /*if (viewCollision)*/ UpdateViewCollision(); if (loader.cinematicsManager != null) { detailedState = "Initializing cinematics"; await new WaitForEndOfFrame(); InitCinematics(); } detailedState = "Finished"; stopwatch.Stop(); state = State.Finished; loadingScreen.Active = false; if (ExportAfterLoad) { MapExporter e = new MapExporter(this.loader, ExportPath); e.Export(); Application.Quit(); } }
// Use this for initialization void Start() { // Read command line arguments string[] args = System.Environment.GetCommandLineArgs(); for (int i = 0; i < args.Length; i++) { switch (args[i]) { case "--lvl": case "-l": lvlName = args[i + 1]; i++; break; case "--folder": case "--directory": case "-d": case "-f": gameDataBinFolder = args[i + 1]; i++; break; case "--mode": case "-m": switch (args[i + 1]) { case "r3_gc": mode = MapLoader.Mode.Rayman3GC; break; case "ra_gc": mode = MapLoader.Mode.RaymanArenaGC; break; case "r3_pc": mode = MapLoader.Mode.Rayman3PC; break; case "ra_pc": mode = MapLoader.Mode.RaymanArenaPC; break; case "r2_pc": mode = MapLoader.Mode.Rayman2PC; break; } break; } } loader = MapLoader.Loader; loader.mode = mode; loader.gameDataBinFolder = gameDataBinFolder; loader.lvlName = lvlName; loader.allowDeadPointers = allowDeadPointers; loader.forceDisplayBackfaces = forceDisplayBackfaces; loader.baseMaterial = baseMaterial; loader.baseTransparentMaterial = baseTransparentMaterial; loader.baseBlendMaterial = baseBlendMaterial; loader.baseBlendTransparentMaterial = baseBlendTransparentMaterial; loader.negativeLightProjectorMaterial = negativeLightProjectorMaterial; loader.baseLightMaterial = baseLightMaterial; loader.Load(); sectorManager.Init(); lightManager.Init(); InitPersos(); if (viewCollision) { UpdateViewCollision(); } }