Image Here I'm trying to do this thing where I type a word into an inputfield, where it's encrypted into L337 casing, and the result is outputted in the text object. But I keep getting the error Object Reference Not set to an Instance of an Object and it points to
inputText = input.text;
 output.text = inputText;
I'm still a bit of a noob. If someone could help me out, I'd appreciate it.
public class Encryption : MonoBehaviour
{
public InputField input;
public Text output;
string inputText;
public Toggle L337Toggle;
 void Start()
{
    output = GetComponent<Text>();
    input = GetComponent<InputField>();
    L337Toggle.isOn = false;
}
private void Update()
{
   inputText = input.text;
    output.text = inputText;
    var textEncryption = new TextEncryption(inputText);
    var L337Encryption = new L337Encryption(textEncryption);
    if (Input.GetKeyDown("enter"))
    {
        if (L337Toggle.isOn == true)
        {
            string result = L337Encryption.encrypt();
        }
    }
}
public interface IEncryption
{
    string encrypt();
}
public class TextEncryption : IEncryption
{
    private string originalString;
    public TextEncryption(string original)
    {
        originalString = original;
    }
    public string encrypt()
    {
        Debug.Log("Encrypting Text");
        return originalString;
    }
}
public class L337Encryption : IEncryption
{
    private IEncryption _encryption;
    public L337Encryption(IEncryption encryption)
    {
        _encryption = encryption;
    }
    public string encrypt()
    {
        Debug.Log("Encrypting L337 Text");
        string result = _encryption.encrypt();
        result = result.Replace('a', '4').Replace('b', '8').Replace('e', '3').Replace('g', '6').Replace('h', '4').Replace('l', '1')
            .Replace('0', '0').Replace('q', '9').Replace('s', '5').Replace('t', '7');
        return result;
    }
}
}
