예제 #1
0
 public void FirePlayerShot()
 {
     if (levelActive && playerShotPool != null && Time.time - lastFireTime >= fireRate)
     {
         lastFireTime = Time.time;
         Transform  pstrans = playerShotPool.Spawn();
         PlayerShot ps      = pstrans.GetComponent <PlayerShot>();
         ps.PlayerShotStart(this);
         pstrans.position     = PositionOnCircle(playerShip.selfTransform.position, playerInput.pathRingTransform.position, shipDistance - ps.spawnShipGap);
         ps.moving            = true;
         ps.movementSpeed     = playerShotSpeed;
         ps.movementDirection = ((Vector2)(playerInput.pathRingTransform.position - pstrans.position)).normalized;
     }
 }