1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using UnityEngine;
- using System.Collections;
- public class SendCodeButtonHandler : MonoBehaviour {
- UILabel _input;
- CodeColaHelper _cch;
- // Use this for initialization
- void Start () {
- _input = GameObject.Find("_input").GetComponent<UILabel>();
- _cch = GameObject.Find("Managers").GetComponent<CodeColaHelper>();
- }
-
- // 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";
- }
- }
|