iphone keyboard ..

private string inputText = "text";
private iPhoneKeyboard keyboard_;
// Updates button's text while user is typing

void OnGUI() {
    if (GUI.Button(new Rect(0, 10, 200, 32), inputText))
        keyboard_ = iPhoneKeyboard.Open(inputText);

        inputText = keyboard_.text;

How can i convert the following line to C# : if(keyboard_)??? Right now i get this error: Cannot implicitly convert type `UnityEngine.iPhoneKeyboard' to`bool' Thanks

C# won't implicitly convert that to a boolean operation. In javascript, the compiler assumes you mean that you want to check if the object is null or has a reference.

In C#, you have to be more explicit in telling it what you meant.

You have to do:

 if(keyboard_ != null) {
      inputText = keyboard_.text;