private void Awake() { instance = this; text = GetComponent <Text>(); anim = GetComponent <Animator>(); }
void Start() { anim = GetComponent <Animator>(); rgb = GetComponent <Rigidbody>(); camera = transform.GetChild(0); playerCamera = camera.GetComponent <Camera>(); objPooler = ObjectPooler.instance; weaponAttachM = GetComponent <WeaponAttachmentManager>(); crossHair = CrossHair.instance; scrMsgLine = ScreenMessageLine.instance; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; currentWeaponMagAmmo = maxAmmo; // Make array with al lthe weapons. weapons = new GameObject[weaponSlot.childCount]; for (int i = 0; i < weaponSlot.childCount; i++) { weapons[i] = weaponSlot.GetChild(i).gameObject; } }