void Start() { weaponSwitch = GetComponent <WeaponSwitch>(); equippedWeapons = new Weapon1[weaponSwitch.maxWeapons]; pause = GetComponent <PauseGame>(); control = GetComponent <PlayerInputControls>(); if (chestDisplay == null) { chestDisplay = transform.GetComponentInChildren <DisplayChestContents>(); } }
// Use this for initialization void Start() { text = GetComponent <Text>(); if (player == null) { player = transform.root.gameObject; } inventory = player.GetComponent <PlayerInventory>(); if (chestDisplay == null) { chestDisplay = transform.parent.parent.GetComponentInChildren <DisplayChestContents>(); } }