Watch this video in context on the official Unity learn pages –
http://www.unity3d.com/learn/tutorials/topics/scripting/reacting-string-input
In this session we will learn how to program a text based adventure game in which the player explores a series of rooms by reading text and inputting commands via the keyboard.