Пример #1
0
 public static PresenterDispatcher GetInstance()
 {
     if (_instance == null)
     {
         _instance = new GameObject("PresenterDispatcher").AddComponent <PresenterDispatcher>();
         _instance.InitActionMapping();
         DontDestroyOnLoad(_instance);
     }
     return(_instance);
 }
Пример #2
0
        public void SendRequest()
        {
            var toSendData = _toSendDataBinders.Select(b => BinderUtil.GetValueFromBinder(b));

            if (!_async)
            {
                var res = PresenterDispatcher.GetInstance().RequestWithMTokens(_url, toSendData.ToArray());
                OnResponse(res);
            }
            else
            {
                PresenterDispatcher.GetInstance().RequestWithMTokensAsync(this, OnResponse, _url, toSendData.ToArray());
            }
        }
Пример #3
0
 public void Broadcast(int index, bool needReceiver = false)
 {
     PresenterDispatcher.GetInstance().BroadcastEvent(Url, new object[] { }, c => ((MFloat)c).Value == index, needReceiver);
 }
Пример #4
0
 public void Broadcast(string id, bool needReceiver = false)
 {
     PresenterDispatcher.GetInstance().BroadcastEvent(Url, new object[] { }, c => ((MString)c).Value == id, needReceiver);
 }
Пример #5
0
 public void UnregistEvent()
 {
     PresenterDispatcher.UnregistPresenterEvent(_url, this);
 }
Пример #6
0
 public void RegistEvent()
 {
     PresenterDispatcher.GetInstance().RegistPresenterEvent(_url, this);
 }