Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using ExitGames.Client.Photon.StructWrapping;
- using UnityEngine;
- namespace DefaultNamespace
- {
- public class Shotgun:Gun
- {
- void Start()
- {
- damage = 5;
- auto = false;
- cooldown = 0;
- speed = 50;
- }
- protected override void OnShoot()
- {
- for (int i = 0; i < 15; i++)
- {
- GameObject bul = Instantiate(bullet);
- bul.transform.position = riffleStart.transform.position;
- float x = Random.Range(-10, 10);
- float y = Random.Range(-15, 15);
- bul.transform.rotation = transform.rotation;
- bul.GetComponent<Bullet>().setDirection(transform.forward+new Vector3(x/100,y/100,0));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement