public void OnCreate() { Maria.Message msg = new Maria.Message(); if (_provice == Provice.Sichuan) { var com = _SCPanel.GetComponent <CRScMahjong>(); msg[CrCode.provice] = Provice.Sichuan; msg[CrCode.hujiaozhuanyi] = com.HuJiaoZhuanYi; msg[CrCode.zimo] = com.ZiMo; msg[CrCode.dianganghua] = com.DianGangHua; msg[CrCode.daiyaojiu] = com.DaiYaoJiu; msg[CrCode.duanyaojiu] = com.DuanYaoJiu; msg[CrCode.jiangdui] = com.JiangDui; msg[CrCode.tiandihu] = com.TianDiHU; msg[CrCode.top] = com.Top; msg[CrCode.ju] = com.Ju; msg[CrCode.overtype] = _overtype; } else if (_provice == Provice.Shaanxi) { var com = _SXPanel.GetComponent <CRSxMahjong>(); msg[CrCode.provice] = Provice.Shaanxi; msg[CrCode.sxqidui] = com.SxHuQiDui; msg[CrCode.sxqingyise] = com.SxQingYiSe; msg[CrCode.ju] = com.Ju; msg[CrCode.overtype] = _overtype; } Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_MUI_CREATE, gameObject, msg); GetComponent <FindApp>().App.Enqueue(cmd); }
static int _g_get_Cmd(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Maria.Command __cl_gen_to_be_invoked = (Maria.Command)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushuint(L, __cl_gen_to_be_invoked.Cmd); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(1); }
static int _s_set_Msg(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Maria.Command __cl_gen_to_be_invoked = (Maria.Command)translator.FastGetCSObj(L, 1); __cl_gen_to_be_invoked.Msg = (Maria.Message)translator.GetObject(L, 2, typeof(Maria.Message)); } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(0); }
void Login(string code) { UnityEngine.Debug.Log(code); Maria.Message msg = new Maria.Message(); msg["username"] = code; msg["password"] = "******"; #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN msg["server"] = "sample1"; #elif UNITY_IOS || UNITY_ANDROID msg["server"] = "sample"; #endif Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_LOGIN, gameObject, msg); Bacon.GL.Util.App.current.Enqueue(cmd); }
static int __CreateInstance(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) { uint cmd = LuaAPI.xlua_touint(L, 2); Maria.Command __cl_gen_ret = new Maria.Command(cmd); translator.Push(L, __cl_gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.GameObject>(L, 3)) { uint cmd = LuaAPI.xlua_touint(L, 2); UnityEngine.GameObject orgin = (UnityEngine.GameObject)translator.GetObject(L, 3, typeof(UnityEngine.GameObject)); Maria.Command __cl_gen_ret = new Maria.Command(cmd, orgin); translator.Push(L, __cl_gen_ret); return(1); } if (LuaAPI.lua_gettop(L) == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <UnityEngine.GameObject>(L, 3) && translator.Assignable <Maria.Message>(L, 4)) { uint cmd = LuaAPI.xlua_touint(L, 2); UnityEngine.GameObject orgin = (UnityEngine.GameObject)translator.GetObject(L, 3, typeof(UnityEngine.GameObject)); Maria.Message msg = (Maria.Message)translator.GetObject(L, 4, typeof(Maria.Message)); Maria.Command __cl_gen_ret = new Maria.Command(cmd, orgin, msg); translator.Push(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to Maria.Command constructor!")); }
static int _m_DispatchCmdEvent(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Maria.EventDispatcher __cl_gen_to_be_invoked = (Maria.EventDispatcher)translator.FastGetCSObj(L, 1); try { { Maria.Command cmd = (Maria.Command)translator.GetObject(L, 2, typeof(Maria.Command)); __cl_gen_to_be_invoked.DispatchCmdEvent(cmd); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_Enqueue(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Maria.Context __cl_gen_to_be_invoked = (Maria.Context)translator.FastGetCSObj(L, 1); { Maria.Command cmd = (Maria.Command)translator.GetObject(L, 2, typeof(Maria.Command)); __cl_gen_to_be_invoked.Enqueue(cmd); return(0); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
public void Enqueue(Maria.Command cmd) { UnityEngine.Debug.Assert(cmd != null); _app.Enqueue(cmd); }
// Update is called once per frame void Update() { if (_touch) { #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (Input.GetMouseButtonDown(0)) { Ray r = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hitInfo; if (Physics.Raycast(r, out hitInfo, 20)) { GameObject hitGo = hitInfo.transform.gameObject; Vector3 lastMousePostion = Input.mousePosition; if (hitGo != null) { _hitGo = hitGo; if (_selectedGo != null && _selectedGo == _hitGo && _lead) { _lead = false; _hitGo = _selectedGo = null; Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_LEAD, _hitGo); _Root.App.Enqueue(cmd); } } } } else if (Input.GetMouseButton(0)) { if (_hitGo != null) { UnityEngine.Debug.LogFormat(Input.mousePosition.ToString()); Vector3 delta = Input.mousePosition - _lastMousePostion; //_hitGo.transform.localPosition = _hitGo.transform.localPosition + new Vector3(delta.x / 1000.0f, 0.0f, delta.y / 1000.0f); } } else if (Input.GetMouseButtonUp(0)) { if (_hitGo != null && _cards.Contains(_hitGo)) { _selectedGo = _hitGo; // trs var dest = _selectedGo.transform.localPosition + new Vector3(0.0f, 0.025f, 0.0f); Matrix4x4 mat = _selectedGo.transform.worldToLocalMatrix * Matrix4x4.Translate(new Vector3(0.0f, 0.025f, 0.0f)); _selectedGo.transform.right = mat.GetRow(0); _selectedGo.transform.up = mat.GetRow(1); _selectedGo.transform.forward = mat.GetRow(2); } _hitGo = null; } #elif UNITY_IOS || UNITY_ANDROID if (Input.touchCount > 0) { if (Input.touches[0].phase == TouchPhase.Began) { Ray r = Camera.main.ScreenPointToRay(Input.touches[0].position); RaycastHit hitInfo; Physics.Raycast(r, out hitInfo, 50); //hitInfo.transform.gameObject; } } #endif } }
public void OnGuo() { CloseAll(); Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_GUO); _Root.App.Enqueue(cmd); }
public void OnPeng() { CloseAll(); Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_PENG); _Root.App.Enqueue(cmd); }
public void OnMatch() { Maria.Command cmd = new Maria.Command(Bacon.Event.MyEventCmd.EVENT_MUI_MATCH); Bacon.GL.Util.App.current.Enqueue(cmd); }
// Use this for initialization void Start() { Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_SETUP_LOGINPANEL, gameObject); Bacon.GL.Util.App.current.Enqueue(cmd); Maria.Util.NotificationCenter.current.AddObserver("AndroidLogin", OnAnroidLogin); }
// Use this for initialization void Start() { Maria.Command cmd = new Maria.Command(MyEventCmd.EVENT_SETUP_LOGINPANEL, gameObject); _Root.App.Enqueue(cmd); Maria.Util.App.current.AddObserver("AndroidLogin", OnAnroidLogin); }