void OnDrawGizmos() { List <Vector3> positions = FibonacciSphere.GeneratePoints(numberFlares, radius); foreach (Vector3 v in positions) { Gizmos.color = Color.red; Gizmos.DrawSphere(v, 0.01f); } }
IEnumerator SpawnParticles() { positions = FibonacciSphere.GeneratePoints(numberFlares, radius - 0.025f); float currentFlares = 0f; foreach (Vector3 p in positions) { currentFlares++; Quaternion rotation = Quaternion.LookRotation(-p, Vector3.up); GameObject flareInstance = Instantiate(flarePrefab, p, rotation); flareInstance.transform.parent = gameObject.transform; yield return(new WaitForSeconds(delaySeconds)); } }