IEnumerator spawn() { while (running) { PlayerShipLaserView playerShipLaser = playerLaserPool.GetInstance(); playerShipLaser.Reinit( playerShipModel.ShotSpawn.position, Quaternion.identity, laserParent ); playerShipLaser.gameObject.AddComponent <OutOfScreenView>(); swElement.Warrior.GetComponent <AudioSource>().Play(); yield return(new WaitForSeconds(playerShipModel.FireRate)); } }
private void OnHitByLaser(EnemyShipView enemyShipView, PlayerShipLaserView playerShipLaserView, int health) { hitByLaserSigal.Dispatch(enemyShipView, playerShipLaserView, health); }
private void OnHitByLaser(AsteroidView asteroidView, PlayerShipLaserView playerShipLaserView, int health) { asteroidHitByLaserSignal.Dispatch(asteroidView, playerShipLaserView, health); }