// Use this for initialization void Start() { Stars = LoadStars.Load(); OrbitCamera.SetMode(CameraMode.Free); OrbitCamera.OrbitLocation(Stars[0]); GuiManager.SetStarFocus(Stars[0]); }
static void CreateStars() { Object[] starMeshes = Object.FindObjectsOfType(typeof(StarMesh)); foreach (var starMesh in starMeshes) { DestroyImmediate((starMesh as StarMesh).gameObject); } Star[] stars = LoadStars.Load(); float min = float.MaxValue; float max = float.MinValue; GetMinMaxAbsMag(stars, ref min, ref max); int maxStarsPerMesh = 15000; for (int i = 0; i < stars.Length; i += maxStarsPerMesh) { //GeneratePointMesh(stars, i, Mathf.Min(maxStarsPerMesh, stars.Length - i), min, max); GenerateMesh(stars, i, Mathf.Min(maxStarsPerMesh, stars.Length - i), min, max); } }