// Use this for initialization void Start() { hp1 = 100; hp2 = 100; p1PlayerModel.SetActive(true); p1Ragdoll.SetActive(false); p2PlayerModel.SetActive(true); p2Ragdoll.SetActive(false); weapon1 = FindObjectOfType <WeaponSwap>(); weapon2 = FindObjectOfType <WeaponSwap2>(); ammo1 = FindObjectOfType <AmmoManager>(); ammo2 = FindObjectOfType <AmmoManager2>(); grenades = FindObjectOfType <GrenadeAmmo>(); }
// Use this for initialization void Start() { //setup any variables/references we will need at the start of the game hitMarker.SetActive(false); torsoMarker.SetActive(false); pickupPrompt.SetActive(false); reloadPrompt.SetActive(false); anim.SetBool("Scoped", false); grenades = FindObjectOfType <GrenadeAmmo>(); player = GetComponent <PlayerController2>(); motor = GetComponent <PlayerMotor>(); //we tell Unity to grab the PlayerMotor script component attached to this object, and call it 'motor'. Now Unity knows what we mean when we say 'motor' later o shoot = GetComponent <PlayerShoot2>(); //we tell Unity to grab the PlayerShoot script component attached to this object, and call it 'shoot.' Now Unity knows what we mean when we say 'shoot' later on spawnEnemy = GetComponent <SpawnEnemy>(); //ref to spawn enemy through the other script grenade = GetComponent <PlayerGrenade>(); //we tell Unity to grab the PlayerGrenade script component attached to this object, and call it 'grenade.' Now Unity knows what we mean when we say 'grenade' later on }