void Start() { tr = transform; root = tr.root; defaultPos = tr.localPosition; defaultArmRot = tr.localEulerAngles; ba = bobAmount; PlayerReference pr = GeneralVariables.playerRef; if (pr != null) { pm = pr.GetComponent <PlayerMovement>(); ac = pr.ac; cb = pr.cb; ia = pr.ia; wm = pr.wm; acs = pr.acs; pl = pr.GetComponent <PlayerLook>(); } lastKickTime = -0.1f; smoothKickFactor = 0.01f; kickSpeedFactor = 1f; animationIsPlaying = false; }
public void Initialize() { UIController uic = GeneralVariables.uiController; weaponName = uic.weaponName; curAmmo = uic.curAmmoDisplay; ammoLeft = uic.ammoLeftDisplay; ammoBar = uic.ammoBar; PlayerReference pr = GeneralVariables.playerRef; gm = transform.parent.GetComponent <GrenadeManager>(); pm = pr.GetComponent <PlayerMovement>(); gam = pr.gam; wm = pr.wm; acs = pr.acs; if (isDetonatable) { canDetonate = true; } OnSelect(); switchToWeapon = -1; canThrow = true; }
public void SetReferenceVars() { PlayerReference pRef = GeneralVariables.playerRef; if (pRef != null) { pe = pRef.GetComponent <PlayerEffects>(); wm = pRef.wm; dm = pRef.dm; pm = pRef.GetComponent <PlayerMovement>(); ac = pRef.ac; acs = pRef.acs; } }
public void RunStart() { if (mpReferenceOnly) { return; } PlayerReference pr = GeneralVariables.playerRef; pl = pr.GetComponent <PlayerLook>(); pm = pr.GetComponent <PlayerMovement>(); wm = pr.wm; dm = pr.dm; ac = pr.ac; acs = pr.acs; tss = firePos.GetComponent <TimeScaleSound>(); UIController uiController = GeneralVariables.uiController; curAmmoDisplay = uiController.curAmmoDisplay; ammoLeftDisplay = uiController.ammoLeftDisplay; ammoBar = uiController.ammoBar; crosshair = uiController.crosshairs; if (muzzleLight != null) { muzzleBrightness = muzzleLight.intensity; } initializeTime = Time.time; PoolManager.Instance.Initialize(); gunVisuals = GetComponent <GunVisuals>(); shootImpulseGUI = 1f; reloadImpulseGUI = 1f; pa = GetComponent <PistolAnim>(); maxIndex = 2; SwitchFiringMethod(); flashlightOn = false; startCounting = false; fireCount = 0; asm = 1f; spreadReal = baseSpreadAmount; bsna = baseSpreadAmount; }
void Start() { camTr = GeneralVariables.mainPlayerCamera.transform; isMeleeState = false; PlayerReference pr = GeneralVariables.playerRef; dm = pr.dm; acs = pr.acs; wm = pr.wm; UIController uic = GeneralVariables.uiController; nameLabel = uic.weaponName; ammoBar = uic.ammoBar; curAmmoLabel = uic.curAmmoDisplay; ammoLeftLabel = uic.ammoLeftDisplay; friendlyFire = NetworkingGeneral.friendlyFire; }
void Start() { PlayerReference pRef = GeneralVariables.playerRef; pm = GeneralVariables.player.GetComponent <PlayerMovement>(); wm = pRef.wm; dm = pRef.dm; pl = pm.GetComponent <PlayerLook>(); pv = pm.GetComponent <PlayerVitals>(); vc = GetComponent <VignettingC>(); wdof = GetComponent <WeaponDepthOfField>(); cb = pRef.cb; acs = pRef.acs; ia = pRef.ia; GetComponent <Camera>().fieldOfView = (float)GameSettings.settingsController.FOV; cachedTr.localPosition = Vector3.zero; lastUnAim = -0.25f; lastAim = -0.25f; lastShake = -100f; }
void Start() { player = GeneralVariables.player; dm = GetComponent <DynamicMovement>(); pm = player.GetComponent <PlayerMovement>(); pv = player.GetComponent <PlayerVitals>(); pl = player.GetComponent <PlayerLook>(); pe = player.GetComponent <PlayerEffects>(); gam = GeneralVariables.playerRef.gam; ac = GeneralVariables.playerRef.ac; acs = GeneralVariables.playerRef.acs; UIController uiController = GeneralVariables.uiController; curAmmoDisplay = uiController.curAmmoDisplay; ammoLeftDisplay = uiController.ammoLeftDisplay; weaponName = uiController.weaponName; weaponIcon = uiController.weaponIcon; weaponSlot = uiController.weaponSlot; ammoBar = uiController.ammoBar; muzGlow = uiController.muzzleHelmetGlow; fireModeDisplay = uiController.fireModeLabel; reloadIndImpulse = uiController.reloadIndicatorLabel.GetComponent <ImpulseGUI>(); grenadeSelection = uiController.grenadeSelectionSprite; grenadeSelectionLabel = uiController.grenadeSelectionLabel; defaultIconPos = new Vector3(-172f, 14f, 2f); grenadeSelectionLabel.alpha = 0.2f; grenadeSelection.transform.localPosition = new Vector3(-35f, 83f, 0f); grenadeManager.gameObject.SetActive(true); grenadeManager.Initialize(); queuedAmmo = -1; queuedReserve = -1; queuedChamber = false; curWeaponNum = -1; if (mpSpawnStartPrimary > -1) { AddWeapon(mpSpawnStartPrimary, false); mpSpawnStartPrimary = -1; } else if (startingPrimary > -1) { AddWeapon(startingPrimary, false); } if (mpSpawnStartSecondary > -1) { AddWeapon(mpSpawnStartSecondary, false); mpSpawnStartSecondary = -1; } else if (startingSecondary > -1) { AddWeapon(startingSecondary, false); } if (Topan.Network.isConnected) { StartCoroutine(WaitForNetworkInit()); } else { FindWeaponToUse(true, 0); } dca = 0f; dal = 0f; displayCurAmmo = 0; displayAmmoLeft = 0; friendlyFire = NetworkingGeneral.friendlyFire; initTime = Time.time; }