Exemplo n.º 1
0
    protected void Shoot()
    {
        float angle   = Mathf.PI / 8;
        float vitproj = Random.Range(0.02f, 0.03f);

        for (float i = 0 + Random.Range(-0.05f, 0.05f); i < Mathf.PI * 2; i += angle)
        {
            gob = SimplePool.Spawn(obj, transform.position, new Quaternion());
            gob.transform.localScale = new Vector3(0.6f, 0.6f, 1);
            BaseProjectile proj = gob.GetComponent <BaseProjectile> ();
            proj.setDegat(1);
            proj.setDirection(new Vector2(Mathf.Cos(i), Mathf.Sin(i)));
            proj.setVitesse(vitproj);
            gob.GetComponent <ProjectileVitesseVariable> ().AjouterAcceleration(5, -0.0007f);
        }
    }