Add public variable of type TouchController
to your script. Then add game object with TouchController
script to your scene. If your script is derived from MonoBehaviour
, in Hierarchy tab in Unity Editor drag and drop game object with TouchController
onto your variable.
If your script is not a MonoBehaviour
script, than you'll have to set this variable manually from some other MonoBehaviour
script.