public override void Start() { FakePrefabHooks.Init(); ItemBuilder.Init(); BasicGun.Add(); ETGModConsole.Log("shit", false); }
private void Awake() { inputs = new InputMaster(); pm = FindObjectOfType <PlayerMoveMent>(); bg = FindObjectOfType <BasicGun>(); pc = FindObjectOfType <PauseController>(); }
// Use this for initialization void Start() { hit = false; controller = GetComponent <CharacterController>(); playerVelocity = new Vector3(0, 0, 0); gun = GetComponentInChildren <BasicGun>(); hurtSound = GetComponent <AudioSource>(); }
public PlayerComponents(GameObject r, int n, int h) { Reference = r; Rb = r.GetComponent <Rigidbody2D>(); Number = n; Health = h; Chaser = r.GetComponent <ChaserMovement>(); Leader = r.GetComponent <LeaderMovement>(); Gun = r.GetComponent <BasicGun>(); }
void PickupNewGun(GameObject gun) { BasicGun gunData = gun.GetComponent <BasicGun>(); bullet = gunData.bullet; speed = gunData.speed; CoolDown = gunData.CoolDown; MAX_PITCH = gunData.maxPitch; MIN_PITCH = gunData.minPitch; PITCH_CYCLE_MAX = gunData.pitchCycleSize; pitchChangeDir = gunData.pitchChangeDir; AS.clip = gunData.bullet.GetComponent <BulletDespawn>().AC; currentPitch = MAX_PITCH; Destroy(currentGun); currentGun = Instantiate(gun, transform.position, Quaternion.identity); currentGun.transform.parent = gameObject.transform; currentGun.GetComponent <BasicGun> ().gunActive = true; }
public void AddGun(GunType type) { if (!_guns.ContainsKey(type)) { if (type == GunType.BasicGun) { _guns[type] = new BasicGun(); } else if (type == GunType.ShotGun) { _guns[type] = new ShotGun(); } else { _guns[type] = new Rifle(); } } _guns[type].IncreaseBullets(); _guns[type].PlayerGun = this; }
void Update() { Cursor.visible = false; if (!gameOver) { if (activeGun.isInputForShooting() && activeGun.HasBullets() && !activeGun.isReloading()) { activeGun.ManageShootBullets(); activeGun.UpdateBulletCount(); } if ((Input.GetKeyDown(ReloadKey) && !activeGun.isReloading() && !activeGun.IsFullyCharged()) || !activeGun.HasBullets()) { activeGun.Reload(); activeGun.UpdateBulletCount(); } if (Input.GetKeyDown(CarryFirstGunKey)) { activeGun.gameObject.SetActive(false); activeGun = guns [0]; activeGun.gameObject.SetActive(true); activeGun.UpdateBulletCount(); } if (Input.GetKeyDown(CarrySecondGunKey)) { activeGun.gameObject.SetActive(false); activeGun = guns [1]; activeGun.gameObject.SetActive(true); activeGun.UpdateBulletCount(); } if (Input.GetKeyDown(InteractKey) && HasInteractiveObject()) { interactiveObject.Interact(); } } }
private void OnPlayerSpawned(Notification note) { currentGun = FindObjectOfType <BasicGun> (); }
void Update() { Cursor.visible = false; if (!gameOver) { if (activeGun.isInputForShooting () && activeGun.HasBullets () && !activeGun.isReloading ()) { activeGun.ManageShootBullets (); activeGun.UpdateBulletCount (); } if ((Input.GetKeyDown (ReloadKey) && !activeGun.isReloading () && !activeGun.IsFullyCharged ()) || !activeGun.HasBullets ()) { activeGun.Reload (); activeGun.UpdateBulletCount (); } if (Input.GetKeyDown (CarryFirstGunKey)) { activeGun.gameObject.SetActive (false); activeGun = guns [0]; activeGun.gameObject.SetActive (true); activeGun.UpdateBulletCount (); } if (Input.GetKeyDown (CarrySecondGunKey)) { activeGun.gameObject.SetActive (false); activeGun = guns [1]; activeGun.gameObject.SetActive (true); activeGun.UpdateBulletCount (); } if (Input.GetKeyDown (InteractKey) && HasInteractiveObject ()) { interactiveObject.Interact (); } } }
void Start() { activeGun = guns [0]; activeGun.gameObject.SetActive (true); }
void Start() { activeGun = guns [0]; activeGun.gameObject.SetActive(true); }