public void RefreshPlatforms() { if (platforms != null) { foreach (CustomPlatform platform in platforms) { Destroy(platform.gameObject); } } platforms = platformLoader.CreateAllPlatforms(transform); // Retrieve saved path from player prefs if it exists if (Plugin.config.HasKey("Data", "CustomPlatformPath")) { string savedPath = Plugin.config.GetString("Data", "CustomPlatformPath"); // Check if this path was loaded and update our platform index for (int i = 0; i < platforms.Length; i++) { if (savedPath == platforms[i].platName + platforms[i].platAuthor) { platformIndex = i; break; } } } ChangeToPlatform(platformIndex); }
/// <summary> /// Initializes the <see cref="PlatformManager"/> /// </summary> internal static void Init() { EnvironmentSceneOverrider.Init(); Anchor.AddComponent <EasterEggs>(); GSM.transitionDidStartEvent += (float ignored) => { TransitionPrep(); }; GSM.transitionDidFinishEvent += (ScenesTransitionSetupDataSO ignored1, DiContainer ignored2) => { TransitionFinalize(); }; AllPlatforms = PlatformLoader.CreateAllPlatforms(Anchor.transform); CurrentPlatform = AllPlatforms[0]; if (CONFIG.HasKey("Data", "CustomPlatformPath")) { string savedPath = CONFIG.GetString("Data", "CustomPlatformPath"); for (int i = 0; i < AllPlatforms.Count; i++) { if (savedPath == AllPlatforms[i].platName + AllPlatforms[i].platAuthor) { CurrentPlatform = AllPlatforms[i]; break; } } } LoadHeart(); }
public void RefreshPlatforms() { if (platforms != null) { foreach (CustomPlatform platform in platforms) { //platform.gameObject.SetActive(false); Destroy(platform.gameObject); } } platforms = platformLoader.CreateAllPlatforms(transform); foreach (var p in platforms) { p.gameObject.SetActive(false); } PlatformFromUserPrefs(); }
internal static void Reload() { AllPlatforms = PlatformLoader.CreateAllPlatforms(Anchor.transform); CurrentPlatform = AllPlatforms[0]; if (CONFIG.HasKey("Data", "CustomPlatformPath")) { string savedPath = CONFIG.GetString("Data", "CustomPlatformPath"); for (int i = 0; i < AllPlatforms.Count; i++) { if (savedPath == AllPlatforms[i].platName + AllPlatforms[i].platAuthor) { CurrentPlatform = AllPlatforms[i]; break; } } } LoadHeart(); }