void Shot(int zRotation) { GameObject shot = Instantiate(ShotPrefab, ShotSpawn.position, new Quaternion(0, 0, zRotation, 0)); shot.layer = LayerMask.NameToLayer("Damage" + skillManager.playerNumber); //ajustar layer da bala HomingBulletController ronnieShot = shot.GetComponent <HomingBulletController>(); BulletHealthController bulletHealthController = shot.GetComponent <BulletHealthController>(); //script bulletHealthController ronnieShot.enemy = skillManager.enemy.transform; ronnieShot.bulletSpeed = shotSpeed; bulletHealthController.bulletDamage = (int)(skillManager.healthController.damageReceived * returnDamage); bulletHealthController.bulletLifeTime = 20.0f; bulletHealthController.healthController = skillManager.healthController; }
private void Shot() { //skillManager.charAnim.Play("Attack1"); GameObject shot = Instantiate(shotPrefab, shotSpawn.position, Quaternion.identity); shot.layer = LayerMask.NameToLayer("Damage" + skillManager.playerNumber); HomingBulletController buzzyShot = shot.GetComponent <HomingBulletController>(); BulletHealthController bulletHealthController = shot.GetComponent <BulletHealthController>(); buzzyShot.enemy = skillManager.enemy.transform; buzzyShot.bulletSpeed = shotSpeed; bulletHealthController.bulletDamage = bulletDamage; bulletHealthController.bulletLifeTime = 5f; bulletHealthController.healthController = skillManager.healthController; }