private void InitEVE() { EVEWrapper.InitEVEWrapper(); if (EVEWrapper.APIReady) { //success UnityEngine.Object[] cloudspqs = FindObjectsOfType(EVEWrapper.EVECloudsPQSType); for (int i = 0; i < cloudspqs.Length; i++) { EVEWrapper.EVECloudsPQS cloudentry = new EVEWrapper.EVECloudsPQS(cloudspqs[i]); if (cloudentry.celestialBody != null) { if (celestialBodyInfo.ContainsKey(cloudentry.celestialBody)) { celestialBodyInfo[cloudentry.celestialBody].cloudsPQS.Add(cloudentry); if (celestialBodyInfo[cloudentry.celestialBody].currentDetailLevel < 4) { cloudentry.enabled = false; } } } } EVEInitialised = true; } }
/// <summary> /// Set visual level of the body. /// Level 0 = Not visible at all. /// Level 1 = lowest level. Greyscale on. Heightmap 32 lowest setting. Shinyness = 0 and Bump map off. /// Level 2 = Greyscale On. Heightmap 64. Shinyness = 0 and Bump map off. /// Level 3 = Greyscale On. Heightmap 128 , original shinyness / 2 and bump map off. /// Level 4 = Greyscale Off. Quarter original detail or 128, original shinyness and bump map off. /// Level 5 = Greyscale off. Half original detail, original shinyness and bump map off. /// Level 6 = Maximum and bump map on. /// </summary> /// <param name="level">integer 0 through 6</param> public void setVisualLevel(int level) { if (mesh == null || currentDetailLevel == level) // disable doing all this job if level is already set, not sure if its correctly working { return; } EVEWrapper.LogFormatted_DebugOnly("setVisualLevel " + level + " for " + Body.bodyName); switch (level) { case 0: //visualHeight = 64; //shiny = 0; //setVisualOn(true); //setBumpOff(); //processEVEClouds(); if (Body.pqsController != null) { Body.pqsController.DeactivateSphere(); Body.pqsController.DisableSphere(); } removeFromPlanetariumCamera(); mesh.enabled = false; currentDetailLevel = 0; break; case 1: if (currentDetailLevel == 0 && Body.pqsController != null) { Body.pqsController.ActivateSphere(); Body.pqsController.EnableSphere(); mesh.enabled = true; } removeFromPlanetariumCamera(); //visualHeight = 64; visualHeight = 32; //shiny = 0; shiny = originalshiny; currentDetailLevel = 1; setVisualOn(true); setBumpOff(); processEVEClouds(); break; case 2: if (currentDetailLevel == 0 && Body.pqsController != null) { Body.pqsController.ActivateSphere(); Body.pqsController.EnableSphere(); mesh.enabled = true; } addToPlanetariumCamera(); //visualHeight = 128; visualHeight = 64; //shiny = 0; shiny = originalshiny; currentDetailLevel = 2; setVisualOn(true); setBumpOff(); processEVEClouds(); break; case 3: if (currentDetailLevel == 0 && Body.pqsController != null) { Body.pqsController.ActivateSphere(); Body.pqsController.EnableSphere(); mesh.enabled = true; } addToPlanetariumCamera(); //visualHeight = originalvisualHeight / 4; visualHeight = 128; //shiny = originalshiny/2; shiny = originalshiny; currentDetailLevel = 3; setVisualOn(true); setBumpOff(); processEVEClouds(); break; case 4: if (currentDetailLevel == 0 && Body.pqsController != null) { Body.pqsController.ActivateSphere(); Body.pqsController.EnableSphere(); mesh.enabled = true; } addToPlanetariumCamera(); visualHeight = Mathf.Max(128, originalvisualHeight / 4); shiny = originalshiny; currentDetailLevel = 4; setVisualOn(false); setBumpOff(); processEVEClouds(); break; case 5: if (currentDetailLevel == 0 && Body.pqsController != null) { Body.pqsController.ActivateSphere(); Body.pqsController.EnableSphere(); mesh.enabled = true; } addToPlanetariumCamera(); visualHeight = originalvisualHeight / 2; shiny = originalshiny; currentDetailLevel = 5; setVisualOn(false); setBumpOff(); processEVEClouds(); break; case 6: if (currentDetailLevel == 0 && Body.pqsController != null) { Body.pqsController.ActivateSphere(); Body.pqsController.EnableSphere(); mesh.enabled = true; } addToPlanetariumCamera(); /*visualHeight = originalvisualHeight; * shiny = originalshiny; * currentDetailLevel = 6; * setVisualOn(false); * setBumpOn(); * processEVEClouds();*/ setVisualOff(); break; } SaveCache(); }