private void Start() { if (databasing) { archivePreviousSession(); } swingRecorder = GameObject.Find("TrainingDummy").GetComponentInChildren <SwingRecorder>(); origin = transform.position; for (int i = 0; i < populationSize; i++) { GameObject bot = Instantiate( botPrefab, new Vector3( origin.x + (i % botsPerRow) * botSquareSpacing, origin.y, origin.z + (i / botsPerRow) * botSquareSpacing), Quaternion.Euler(0, 180, 0) ); bot.GetComponent <Brain>().Init(true); population.Add(bot); } if (archivedPopulationEndpoint.Length > 0 && databasing) { loadArchivedPopulation(); } }
private void Start() { SwingRecorder swingRecorder = GameObject.Find("TrainingDummy").GetComponentInChildren <SwingRecorder>(); swingRecorder.swordMotionReproducers.Add(GetComponent <SwordMotionReproducer>()); originalMovementPoints = swingRecorder.swordPath; rootPosition = transform.position; Init(); sword = GetComponent <Rigidbody>(); }