void Shoot() { foreach (Vector3 p in GeometricPatterns.GetIcosphereVertices(1)) { GameObject b = GameObject.Instantiate(bullet); b.transform.position = transform.position; b.transform.forward = p; b.GetComponent <Bullet>().Shoot(shotSpeed); } GeometricPatterns.CreateIcosphere(1); }
public void Branch() { Vector3[] branches = GeometricPatterns.BranchVector(transform.forward, amount, angle); Debug.Log(branches.Length); for (int i = 0; i < amount; i++) { GameObject b = GameObject.Instantiate(shot); b.transform.position = transform.position; b.transform.forward = branches[i]; b.GetComponent <Bullet>().Shoot(0.5f); } Destroy(this.gameObject); }