private void RingWhenArrived() { if (newLampion != null && targetSpace != null) { if ((int)newLampion.transform.position.x == (int)targetSpace.transform.position.x && (int)newLampion.transform.position.z == (int)targetSpace.transform.position.z) { audioPlayer.Play(); newLampion = null; targetSpace = null; } } }
private void Send(Lampion _newLampion, FarmlandSpace _targetSpace) { newLampion = _newLampion; targetSpace = _targetSpace; // Select random spawn point newLampion.transform.localPosition = new Vector3(spawnRadius * Random.value, 0, 0); newLampion.transform.RotateAround( newLampion.transform.parent.position, Vector3.up, 360 * Random.value ); // send Lampion by setting TravelTarget targetSpace.Lampion = newLampion; newLampion.TravelTarget = targetSpace.transform.position; }