Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 private void Awake()
 {
     if ((object)_instance == null)
     {
         _instance = GetComponent <MobileInput>();
         Init();
     }
 }
Пример #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) { }
 }
Пример #3
0
        /// <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
        }
Пример #4
0
 /// <summary>
 /// Send data to plugin
 /// </summary>
 /// <param name="data">Data</param>
 protected void Execute(JsonObject data)
 {
     MobileInput.Execute(_id, data);
 }
Пример #5
0
 /// <summary>
 /// Action on destroy
 /// </summary>
 protected virtual void OnDestroy()
 {
     MobileInput.RemoveReceiver(_id);
 }
Пример #6
0
 /// <summary>
 /// Init input and register interface
 /// </summary>
 protected virtual void Start()
 {
     _id = MobileInput.Register(this);
 }