示例#1
0
    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);
    }
示例#2
0
 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);
 }