private void oldOnGUI() { if (EditorApplication.isPaused) { StartCoroutine(TrainNetwork()); print("pause"); int bestcheckpoint = -1; IANeuralInput bestcart = null; for (int i = 0; i < karts; i++) { if (bestcheckpoint < iaKarts[i].checkpoint) { bestcheckpoint = iaKarts[i].checkpoint; bestcart = iaKarts[i]; } } if (bestcheckpoint > 0) { print("salvando melhor"); var cubeRenderer = bestcart.gameObject.GetComponentInChildren <Renderer>(); cubeRenderer.material.SetColor("_Color", Color.red); //bestiaturnDNA = bestcart.GetDNA(); //PlayerPrefsX.SetFloatArray("BestIA", bestiaturnDNA); } } }
void ResetSim() { int bestcheckpoint = -1; IANeuralInput bestcart = null; currentRun++; for (int i = 0; i < karts; i++) { if (bestcheckpoint < iaKarts[i].checkpoint) { bestcheckpoint = iaKarts[i].checkpoint; bestcart = iaKarts[i]; } } if (bestcheckpoint > 0) { iaKarts[0].Reset(); } }