/// <summary>
 /// Constructor
 /// </summary>
 private void Awake()
 {
     if ((object)_instance == null)
     {
         _instance = GetComponent <MobileInput>();
         Init();
     }
 }
Exemple #2
0
 /// <summary>
 /// Send data to plugin
 /// </summary>
 /// <param name="data">Data</param>
 protected void Execute(JsonObject data)
 {
     try
     {
         MobileInput.Execute(_id, data);
     }
     catch (Exception) { }
 }
        /// <summary>
        /// Init input and register interface
        /// </summary>
        protected virtual void Start()
        {
            _id = MobileInput.Register(this);
#if UNITY_EDITOR
            yoyohan.GameTools.AddTriggersListener(gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction <UnityEngine.EventSystems.BaseEventData>(v => {
                if (MobileInput.OnFocus != null)
                {
                    MobileInput.OnFocus(this._id);
                }
                if (MobileInput.OnShowKeyboard != null)
                {
                    MobileInput.OnShowKeyboard(true, 350);
                }
            }));
#endif
        }
 /// <summary>
 /// Send data to plugin
 /// </summary>
 /// <param name="data">Data</param>
 protected void Execute(JsonObject data)
 {
     MobileInput.Execute(_id, data);
 }
 /// <summary>
 /// Action on destroy
 /// </summary>
 protected virtual void OnDestroy()
 {
     MobileInput.RemoveReceiver(_id);
 }
 /// <summary>
 /// Init input and register interface
 /// </summary>
 protected virtual void Start()
 {
     _id = MobileInput.Register(this);
 }