I would recommend watching this course if you're new to scripting in Unity: https://cgcookie.com/course/c-bootcamp-for-unity/ This course really just focuses on UI. You can copy and paste a script created by someone else into your own script in Unity but I'd recommend going through the course linked to better understand the process.