private void OnValidate() { if (Application.isPlaying) { NBodyC.SetParams(gravConstant, blackHoleCombineDistance); } }
private IEnumerator Start() { NBodyC.SetParams(gravConstant, blackHoleCombineDistance); _trailMesh = new Mesh(); _trailMesh.MarkDynamic(); _trailPropertyBlock = new MaterialPropertyBlock(); prevPos.Create(); currPos.Create(); nextPos.Create(); prevPos.DiscardContents(); currPos.DiscardContents(); nextPos.DiscardContents(); ResetSimulation(); yield return(null); yield return(null); ResetSimulation(); }