AVANCE 9.


Finalmente esta semana estuve trabajando con las funcionalidades de cada arma. 

public class WeaponReader : MonoBehaviour
{     public static WeaponReader Instance;     private Gun currentGun;     public int actualBulletDamage;     public int actualbullets;     public int actualPlayerSpeed;     public float actualshootDelay = 0.2f;     public string actualTypeOfShoot;     public float bigShootCooldown = 5f;     public int actualcartuchos;     public Guns guns;     public Transform shootSpawn;     public GameObject[] bulletPrefabs = new GameObject[1];     public List<Arma> armasDisponibles;     public bool shooting;     public float lastShootTime = 0f;     private int selectedBulletIndex = 0;     public int bulletCount = 4;     float spreadAngle = 10f;     private void Awake()     {         Instance = this;         UpdateGun(0);     }     public void UpdateGun(int NumberGun)     {         currentGun = guns.GunList[NumberGun];         actualBulletDamage = currentGun.BulletDamage;         actualPlayerSpeed = currentGun.PlayerSpeed;         actualbullets = currentGun.bullets;         actualcartuchos = currentGun.cartuchos;         actualTypeOfShoot = currentGun.TypeOfShoot;     }     public void Shoot()     {         if (Time.time - lastShootTime > actualshootDelay && actualbullets > 0)         {             switch (actualTypeOfShoot)             {                 case "Single":                     InstantiateBullet();                     break;                 case "Burst":                     StartCoroutine(ShootBurst());                     break;                 case "Auto":                     StartCoroutine(ShootAuto());                     break;                 case "Quad":                     StartCoroutine(ShootQuad());  // Llama a la nueva función                     break;                 case "Big":                     StartCoroutine(ShootBig());                     break;                 case "Placapla":                     StartCoroutine(ShootPlacapla());                     break;             }

Y de esta forma fui llamándolos. 


Files

EntrgableShooterLis.zip 836 MB
3 days ago

Get UPGRADE SYSTEM

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.