using UnityEngine; using System.Collections; public class SendCodeButtonHandler : MonoBehaviour { UILabel _input; CodeColaHelper _cch; // Use this for initialization void Start () { _input = GameObject.Find("_input").GetComponent(); _cch = GameObject.Find("Managers").GetComponent(); } // Update is called once per frame void Update () { } public void OnClick() { //Debug.Log("CODE : " + _input.text + " CodeLength : " + _input.text.Length); RegisterCodeMIX.Instance.Activate(_input.text, (state, error) => { switch (state) { case RegisterCodeMIX.ActivateStates.OtherError: //todo: handle error break; case RegisterCodeMIX.ActivateStates.RequestOrNetworkError: //todo: handle error break; case RegisterCodeMIX.ActivateStates.CouponAlreadyReedemed: //todo: handle error break; case RegisterCodeMIX.ActivateStates.BadInput: //todo: handle error break; case RegisterCodeMIX.ActivateStates.Done: //todo: EVERYTHING GOES WELL break; } }); //_cch.StartCheckCode(_input.text); _input.text = "enter code here"; } }