also, in a script, we can modify other components such as “RigidBody”, “Collider”, or even another “Script”
to modify components in a script we need variables as a bowl for the component and we need to put the component in the variable by using “GetComponent()”
“PlayerControl” Script | Creating a Varaible
Create a variable “GameManager” as a bowl to bring and use “Gamemanger” script or class in this script
“GameManager” Script | Custom Function
there is a custom function, “SetGameManagerState()” in “GameManager” script or calss
“PlayerControl” Script | GetComponent()
put the class in the variable by using “GetComponent()”
after that, we can use the functionality of “GameManager” class in this script
“Player” GameObject | Inspector | Audio Source
in “Player” GameObject,
“PlayerControl” scrip & “Audio Source” are attached
we want to use “Audio Source” in “PlayerControl” Script