LegitTeddyBears

Pickups

Jun 22nd, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Pickups : MonoBehaviour {
  6.     public int StrMult = 5;
  7.     public int SpeedMult = 3;
  8.     public int DmgMult = 10;
  9.     public List<Weapon> BulletE;
  10.     Weapon LeftBullet;
  11.     Weapon RightBullet;
  12.     public ImpactExplosion OSA;
  13.     public PlayerControl PC;
  14.  
  15.     // Use this for initialization
  16.  
  17.     void Start()
  18.     {
  19.         RightBullet = BulletE[0];
  20.         LeftBullet = BulletE[1];
  21.     }
  22.  
  23.     void OnTriggerEnter(Collider collider)
  24.     {
  25.         if (collider.gameObject.name == "Pickup_Speed")
  26.         {
  27.             PC.Base_Speed = PC.Base_Speed * SpeedMult;
  28.             collider.gameObject.SetActive(false);
  29.         }
  30.         if (collider.gameObject.name == "Pickup_Dmg")
  31.         {
  32.             LeftBullet.Dmg = LeftBullet.Dmg * DmgMult;
  33.             RightBullet.Dmg = RightBullet.Dmg * DmgMult;
  34.             collider.gameObject.SetActive(false);
  35.         }
  36.         if (collider.gameObject.name == "Pickup_Str")
  37.         {
  38.             OSA.Strength = OSA.Strength * StrMult;
  39.             collider.gameObject.SetActive(false);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment