Пример #1
0
    static int _CreateInputUIOnClickEvent(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                InputUIOnClickEvent obj = new InputUIOnClickEvent();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(string), typeof(string)))
            {
                string arg0             = ToLua.CheckString(L, 1);
                string arg1             = ToLua.CheckString(L, 2);
                string arg2             = ToLua.CheckString(L, 3);
                InputUIOnClickEvent obj = new InputUIOnClickEvent(arg0, arg1, arg2);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: InputUIOnClickEvent.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Пример #2
0
 public void Call(InputUIOnClickEvent param0)
 {
     func.BeginPCall();
     func.PushObject(param0);
     func.PCall();
     func.EndPCall();
 }
 void ReceviceClickEvent(InputUIOnClickEvent e)
 {
     if (GetClickToNext(m_currentGuideData) && GuideClickFilter(e))
     {
         NextGuide();
     }
 }
Пример #4
0
    void OnClickElement_4(InputUIOnClickEvent e)
    {
        int index = 4;

        AddElement(index);
        UpdateUI();
    }
Пример #5
0
    public void onCLick(InputUIOnClickEvent Event)
    {
        Debug.Log("onCLick" + Event.Serialize());
        //Debug.Log("onCLick");
        //UIManager.CloseUIWindow(this);

        Debug.Log(Screen.width + "  " + Screen.height);
    }
Пример #6
0
    void OnClickAnswer(InputUIOnClickEvent e)
    {
        int index = int.Parse(e.m_pram) - 1;

        CreatePoemItem(GameLogic.GetCurrentContent(), GameLogic.SetAnswer(index), GetRectTransform(e.m_compName).anchoredPosition3D - new Vector3(0, Screen.height / 2, 0));

        HideQusetionAnim(index);
    }
Пример #7
0
    public void onCLick(InputUIOnClickEvent Event)
    {
        Debug.Log("onCLick" + Event.Serialize());
        //Debug.Log("onCLick");
        //UIManager.CloseUIWindow(this);

        Debug.Log(Screen.width + "  " + Screen.height);
    }
    //public static void DispatchUIEvent<T>(string UIName, string ComponentName, string parm) where T : InputUIEventBase, new()
    //{
    //    //只有允许输入时才派发事件
    //    if (IsActive)
    //    {
    //        T eventTmp = GetUIEvent<T>(UIName, ComponentName, parm);
    //        InputManager.Dispatch<T>(eventTmp);
    //    }
    //}

    public static void DispatchOnClickEvent(string UIName, string ComponentName, string parm)
    {
        //只有允许输入时才派发事件
        if (IsActive)
        {
            InputUIOnClickEvent e = GetUIEvent <InputUIOnClickEvent>(UIName, ComponentName, parm);
            InputManager.Dispatch("InputUIOnClickEvent", e);
        }
    }
Пример #9
0
 public static void DispatchClickEvent(string UIName, string ComponentName, string parm)
 {
     //只有允许输入时才派发事件
     if (IsActive)
     {
         InputUIOnClickEvent eventTmp = new InputUIOnClickEvent(UIName, ComponentName, parm);
         InputManager.Dispatch <InputUIOnClickEvent>(eventTmp);
     }
 }
Пример #10
0
    /// <summary>
    /// 取消创建房间
    /// </summary>
    /// <param name="e"></param>
    void OnBackButtonClicked(InputUIOnClickEvent e)
    {
        if (PhotonNetwork.InLobby)
        {
            PhotonNetwork.LeaveLobby();
        }

        BackToSelectPanel();
    }
Пример #11
0
    public void OnRoomListButtonClicked(InputUIOnClickEvent e)
    {
        if (!PhotonNetwork.InLobby)
        {
            PhotonNetwork.JoinLobby();
        }

        SetActivePanel(m_roomListPanel.name);
    }
Пример #12
0
    public void OnBackLobbyButtonClicked(InputUIOnClickEvent e)
    {
        if (PhotonNetwork.InLobby)
        {
            PhotonNetwork.LeaveLobby();
        }

        SetActivePanel(m_selectionPanel.name);
    }
        void ReceviceClickEvent(InputUIOnClickEvent e)
        {
            Debug.Log(" ReceviceClickEvent ");

            if (IsStart && GetClickToNext(m_currentGuideData) && GuideClickFilter(e))
            {
                NextGuide();
            }
        }
Пример #14
0
    // 按钮消息接受
    public void OnRecvClick(InputUIOnClickEvent e)
    {
        MessageManager.Message kMsg = new MessageManager.Message();
        kMsg.m_eType     = MessageManager.MessageType.MT_DialogClick;
        kMsg.m_dicParams = new Dictionary <string, string> ();
        MessageManager kMessageManager = ApplicationStatusManager.GetStatus <GameStatus>().GetLogicMain().GetModule("MessageManager") as MessageManager;

        kMessageManager.AddMessage(kMsg);
        Debug.Log("Dialog Window On Clicked");
    }
Пример #15
0
 void OnClickItem(InputUIOnClickEvent e)
 {
     if (GameOptionService.PoemTypes.Contains(m_poemLib))
     {
         GameOptionService.RemovePoemType(m_poemLib);
     }
     else
     {
         GameOptionService.AddPoemType(m_poemLib);
     }
 }
Пример #16
0
 void OnClickDifficult(InputUIOnClickEvent e)
 {
     if (GameOptionService.DifficultyLevels.Contains(e.m_pram))
     {
         GameOptionService.RemoveDifficulty(e.m_pram);
     }
     else
     {
         GameOptionService.AddDifficulty(e.m_pram);
     }
 }
Пример #17
0
        /// <summary>
        /// 引导点击过滤器,返回true通过
        /// </summary>
        protected virtual bool GuideClickFilter(InputUIOnClickEvent e)
        {
            //if(GetGuideWindowName(m_currentGuideData) != null)
            //{
            //    if(!e.EventKey.Contains(GetGuideWindowName(m_currentGuideData)))
            //    {
            //        return false;
            //    }
            //}

            if (GetGuideObjectNames(m_currentGuideData).Length != 0)
            {
                string[] objnames = GetGuideObjectNames(m_currentGuideData);
                bool     isExist  = false;
                for (int i = 0; i < objnames.Length; i++)
                {
                    string objName = GetObjName(objnames[i]);

                    if (e.EventKey.Contains(objName))
                    {
                        isExist = true;
                    }
                }

                if (!isExist)
                {
                    return(false);
                }
            }

            if (GetGuideItemNames(m_currentGuideData).Length != 0)
            {
                string[] objnames = GetGuideItemNames(m_currentGuideData);
                bool     isExist  = false;
                for (int i = 0; i < objnames.Length; i++)
                {
                    string itemName = GetObjName(objnames[i]);

                    if (e.EventKey.Contains(objnames[i]))
                    {
                        isExist = true;
                    }
                }

                if (!isExist)
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #18
0
    public void OnStartGameButtonClicked(InputUIOnClickEvent e)
    {
        PhotonNetwork.AutomaticallySyncScene = true;

        Debug.Log(PhotonNetwork.CurrentRoom.PlayerCount);

        PhotonNetwork.CurrentRoom.IsOpen    = false;
        PhotonNetwork.CurrentRoom.IsVisible = false;

        UIManager.CloseUIWindow <LobbyWindow>();

        PhotonNetwork.LoadLevel("3D");
    }
Пример #19
0
    void OnClickFavoriteSwitch(InputUIOnClickEvent e)
    {
        UpdateFavoriteSwitch();

        if (FavoritesService.GetIsFavorites(s_poemData.m_key))
        {
            FavoritesService.RemoveFavoite(s_poemData.m_key);
        }
        else
        {
            FavoritesService.AddFavorites(s_poemData.m_key);
        }
    }
    void OnClickExercise(InputUIOnClickEvent e)
    {
        Dictionary <string, object> data = new Dictionary <string, object>();

        data.Add("GameType", "FavoritesList");
        data.Add("FavoritesListCount", FavoritesService.GetFavoritesList().Count);
        SDKManager.Log("StartGame", data);

        UIManager.CloseUIWindow(this);

        GameLogic.s_GameModel = GameModel.normal;
        PoemLibrary.SetPoemByFavorite(FavoritesService.GetFavoritesList());
        ApplicationStatusManager.EnterStatus <GameStatus>();
    }
Пример #21
0
    public void OnLoginButtonClicked(InputUIOnClickEvent e)
    {
        string playerName = m_nameField.text;

        if (!playerName.Equals(""))
        {
            PhotonNetwork.LocalPlayer.NickName = playerName;
            PhotonNetwork.ConnectUsingSettings();
        }
        else
        {
            Debug.LogError("Player Name is invalid.");
        }
    }
Пример #22
0
    public static InputButtonClickRegisterInfo GetOnClickListener(Button button, string UIName, string ComponentName, string parm, InputEventHandle <InputUIOnClickEvent> callback)
    {
        InputButtonClickRegisterInfo info = HeapObjectPool <InputButtonClickRegisterInfo> .GetObject();

        info.eventKey  = InputUIOnClickEvent.GetEventKey(UIName, ComponentName, parm);
        info.callBack  = callback;
        info.m_button  = button;
        info.m_OnClick = () =>
        {
            DispatchOnClickEvent(UIName, ComponentName, parm);
        };

        return(info);
    }
Пример #23
0
    void OnClickExercise(InputUIOnClickEvent e)
    {
        Dictionary <string, object> data = new Dictionary <string, object>();

        data.Add("GameType", "singlePoem");
        data.Add("poemName", s_poemData.m_key);
        SDKManager.Log("StartGame", data);

        UIManager.CloseUIWindow(this);

        GameLogic.s_GameModel = GameModel.normal;
        PoemLibrary.SetPoemByName(s_poemData.m_key);
        ApplicationStatusManager.EnterStatus <GameStatus>();
    }
Пример #24
0
    //TODO 逐步添加所有的移除监听方法

    public InputEventRegisterInfo <InputUIOnClickEvent> GetClickRegisterInfo(string buttonName, InputEventHandle <InputUIOnClickEvent> callback, string parm)
    {
        string eventKey = InputUIOnClickEvent.GetEventKey(UIEventKey, buttonName, parm);

        for (int i = 0; i < m_OnClickEvents.Count; i++)
        {
            if (m_OnClickEvents[i].eventKey == eventKey &&
                m_OnClickEvents[i].callBack == callback)
            {
                return(m_OnClickEvents[i]);
            }
        }

        throw new Exception("GetClickRegisterInfo Exception not find RegisterInfo by " + buttonName + " parm " + parm);
    }
Пример #25
0
 static int GetEventKey(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         string arg0 = ToLua.CheckString(L, 1);
         string arg1 = ToLua.CheckString(L, 2);
         string arg2 = ToLua.CheckString(L, 3);
         string o    = InputUIOnClickEvent.GetEventKey(arg0, arg1, arg2);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #26
0
    /// <summary>
    /// 创建房间
    /// </summary>
    public void OnCreateRoomButtonClicked(InputUIOnClickEvent e)
    {
        string roomName = m_roomNameInputField.text;

        roomName = (roomName.Equals(string.Empty)) ? "Room " + Random.Range(1000, 10000) : roomName;

        byte maxPlayers;

        byte.TryParse(m_maxPlayersInputField.text, out maxPlayers);
        maxPlayers = (byte)Mathf.Clamp(maxPlayers, 2, 8);

        RoomOptions options = new RoomOptions {
            MaxPlayers = maxPlayers, PlayerTtl = 10000
        };

        PhotonNetwork.CreateRoom(roomName, options, null);
    }
Пример #27
0
    static void InitPool()
    {
        if (!isInit)
        {
            isInit       = true;
            m_scrollPool = new InputUIOnScrollEvent[c_clickPoolSize];
            for (int i = 0; i < c_clickPoolSize; i++)
            {
                m_scrollPool[i] = new InputUIOnScrollEvent();
            }

            m_clickPool = new InputUIOnClickEvent[c_srollPoolSize];
            for (int i = 0; i < c_srollPoolSize; i++)
            {
                m_clickPool[i] = new InputUIOnClickEvent();
            }
        }
    }
Пример #28
0
    public static InputEventRegisterInfo <InputUIOnClickEvent> AddOnClickListener(Button button, string UIName, string ComponentName, string parm, InputEventHandle <InputUIOnClickEvent> callback)
    {
        InputButtonClickRegisterInfo info = new InputButtonClickRegisterInfo();

        info.eventKey  = InputUIOnClickEvent.GetEventKey(UIName, ComponentName, parm);
        info.callBack  = callback;
        info.m_button  = button;
        info.m_OnClick = () =>
        {
            DispatchClickEvent(UIName, ComponentName, parm);
        };

        info.AddListener();

        button.onClick.AddListener(info.m_OnClick);

        return(info);
    }
Пример #29
0
    static InputUIOnClickEvent GetClickEvent(string UIName, string ComponentName, string parm)
    {
        InputUIOnClickEvent msg = m_clickPool[m_clickIndex];

        msg.Reset();

        msg.m_name     = UIName;
        msg.m_compName = ComponentName;
        msg.m_pram     = parm;

        m_clickIndex++;

        if (m_clickIndex >= m_clickPool.Length)
        {
            m_clickIndex = 0;
        }

        return(msg);
    }
Пример #30
0
 public void OnClick(InputUIOnClickEvent e)
 {
     Debug.Log("item onclick " + m_index);
 }
Пример #31
0
 public void OnClick(InputUIOnClickEvent e)
 {
     Debug.Log("item onclick " + m_index);
 }
Пример #32
0
 /// <summary>
 /// 引导点击过滤器,返回true通过
 /// </summary>
 protected virtual bool GuideClickFilter(InputUIOnClickEvent e)
 {
     return(true);
 }
Пример #33
0
 public void close(InputUIOnClickEvent Event)
 {
     UIManager.CloseUIWindow<test01Window>();
 }
Пример #34
0
 public void open(InputUIOnClickEvent Event)
 {
     UIManager.OpenUIWindow<test01Window>();
 }