how to access the dictionary from another script in unity

C#
 if (Input.GetButtonDown("Reload"))         {             remainingClips = GameObject.FindGameObjectWithTag("InventoryController").GetComponent<InventoryClass>().playerAmmo[weaponType];             if (remainingClips > 0)             {                 Reload();             }
Source

Also in C#: