Exemplo n.º 1
0
 public void FireCross(Vector3 pos, float range)
 {
     for (int i = 1; i < 5; i++)
     {
         var project = new PlayerProjectile();
         project = playerProjectile.MakeInstance(bulletBox.gameObject);
         //project.weaponStats.Init(4);
         project.Init(20);
         project.Setting(damage / 4, range);
         project.transform.position = pos;
         if (i == 1)
         {
             Vector2 targ = new Vector2(pos.x, pos.y + 1.0f);
             project.SetTarget(targ);
         }
         if (i == 2)
         {
             Vector2 targ = new Vector2(pos.x, pos.y + -1.0f);
             project.SetTarget(targ);
         }
         if (i == 3)
         {
             Vector2 targ = new Vector2(pos.x + 1.0f, pos.y);
             project.SetTarget(targ);
         }
         if (i == 4)
         {
             Vector2 targ = new Vector2(pos.x + -1.0f, pos.y);
             project.SetTarget(targ);
         }
     }
 }