Пример #1
0
        public override bool OnMessage(SceneMenu e, MessageInfo message)
        {
            // メッセージタイプが一致している箇所に
            switch (message.messageType)
            {
            case MessageType.ClickAnyButton:

                // byte[]→構造体
                AnyButton info = new AnyButton();
                message.GetExtraInfo <AnyButton>(ref info);
                //+-------------------------------------------------------------
                // ★選択したアイコンのタイプに変更
                switch ((NET_BATTLE_TYPE)info.Index)
                {
                //case NET_BATTLE_TYPE.SERVER:
                //    e.m_pStateMachine.ChangeState(NetBattleHostSelected.GetInstance());
                //    break;
                //case NET_BATTLE_TYPE.CLIENT:
                //    e.m_pStateMachine.ChangeState(NetBattleClientSelected.GetInstance());
                //    break;
                case NET_BATTLE_TYPE.SERVER:
                    // セレクトデータ保存
                    SelectData.networkType = NETWORK_TYPE.HOST;
                    // ネットワークロビーに行く
                    e.m_bSceneChange = true;
                    SceneManager.LoadScene("NetworkLobby");
                    break;

                case NET_BATTLE_TYPE.CLIENT:
                    // セレクトデータ保存
                    SelectData.networkType = NETWORK_TYPE.CLIENT;
                    // IPアドレス保存
                    PlayerDataManager.GetPlayerData().ip = e.ipInput.text;
                    // ネットワークロビーに行く
                    e.m_bSceneChange = true;
                    SceneManager.LoadScene("NetworkLobby");
                    break;

                case NET_BATTLE_TYPE.END:
                default:
                    //+-------------------------------------------------------------------
                    // もどる
                    e.m_pStateMachine.ChangeState(SceneMenuState.BattleSelect.GetInstance());
                    // 01/22 Exit関数からここに移動
                    e.BlackPanel.SetActive(false);
                    break;
                }

                return(true);    // trueを返して終り

            default:

                break;
            }
            return(false); // 何も引っかからなかった
        }
Пример #2
0
        internal Mouse()
        {
            buttons = new Dictionary <ButtonCode, Button>();

            Left    = AddButton(ButtonCode.Left);
            Right   = AddButton(ButtonCode.Right);
            Middle  = AddButton(ButtonCode.Middle);
            Button1 = AddButton(ButtonCode.X1);
            Button2 = AddButton(ButtonCode.X2);
            Any     = new AnyButton(Left, Right, Middle, Button1, Button2);
        }
Пример #3
0
        public override bool OnMessage(SceneDeck e, MessageInfo message)
        {
            // メッセージタイプが一致している箇所に
            switch (message.messageType)
            {
            case MessageType.ClickAnyButton:

                // byte[]→構造体
                AnyButton info = new AnyButton();
                IntPtr    ptr  = Marshal.AllocHGlobal(Marshal.SizeOf(info));
                Marshal.Copy(message.exInfo, 0, ptr, Marshal.SizeOf(info));
                info = (AnyButton)Marshal.PtrToStructure(ptr, info.GetType());
                Marshal.FreeHGlobal(ptr);
                //+-------------------------------------------------------------
                // ★選択したアイコンのタイプに変更
                //switch ((NET_BATTLE_TYPE)info.Index)
                //{
                //    case NET_BATTLE_TYPE.SERVER:

                //        break;
                //    case NET_BATTLE_TYPE.CLIENT:

                //        break;
                //    case NET_BATTLE_TYPE.END:
                //    default:
                //        //+-------------------------------------------------------------------
                //        // もどる
                //        e.m_pStateMachine.ChangeState(SceneMenuState.BattleSelect.GetInstance());
                //        break;
                //}

                //+-------------------------------------------------------------------
                // もどる
                e.m_pStateMachine.ChangeState(SceneDeckState.Main.GetInstance());

                return(true);    // trueを返して終り

            default:

                break;
            }

            return(false); // 何も引っかからなかった
        }
Пример #4
0
        public override bool OnMessage(SceneMenu e, MessageInfo message)
        {
            // メッセージタイプが一致している箇所に
            switch (message.messageType)
            {
            case MessageType.ClickAnyButton:

                // byte[]→構造体
                AnyButton info = new AnyButton();
                message.GetExtraInfo <AnyButton>(ref info);
                //+-------------------------------------------------------------
                // ★選択したアイコンのタイプに変更
                switch (info.Index)
                {
                case 1:

                    e.Tips1.SetActive(false);
                    e.Tips2.SetActive(false);
                    e.Tips3.SetActive(false);
                    e.Tips4.SetActive(false);
                    //e.Tips5.SetActive(false);

                    e.Tips1.SetActive(true);
                    break;

                case 2:
                    e.Tips1.SetActive(false);
                    e.Tips2.SetActive(false);
                    e.Tips3.SetActive(false);
                    e.Tips4.SetActive(false);
                    // e.Tips5.SetActive(false);

                    e.Tips2.SetActive(true);
                    break;

                case 3:
                    e.Tips1.SetActive(false);
                    e.Tips2.SetActive(false);
                    e.Tips3.SetActive(false);
                    e.Tips4.SetActive(false);
                    // e.Tips5.SetActive(false);

                    e.Tips3.SetActive(true);
                    break;

                case 4:
                    e.Tips1.SetActive(false);
                    e.Tips2.SetActive(false);
                    e.Tips3.SetActive(false);
                    e.Tips4.SetActive(false);
                    //e.Tips5.SetActive(false);

                    e.Tips4.SetActive(true);
                    break;
                //case 5:
                //    e.Tips1.SetActive(false);
                //    e.Tips2.SetActive(false);
                //    e.Tips3.SetActive(false);
                //    e.Tips4.SetActive(false);
                //    e.Tips5.SetActive(false);

                //    e.Tips5.SetActive(true);
                //    break;
                default:
                    //+-------------------------------------------------------------------
                    // もどる
                    e.m_pStateMachine.ChangeState(SceneMenuState.BattleSelect.GetInstance());
                    break;
                }

                return(true);    // trueを返して終り

            default:

                break;
            }
            return(false); // 何も引っかからなかった
        }
Пример #5
0
        internal Keyboard()
        {
            keylist = new List <XNA.Keys>();
            allKeys = new List <Button>();
            keys    = new Dictionary <XNA.Keys, Button>();

            A = AddKey(XNA.Keys.A);
            B = AddKey(XNA.Keys.B);
            C = AddKey(XNA.Keys.C);
            D = AddKey(XNA.Keys.D);
            E = AddKey(XNA.Keys.E);
            F = AddKey(XNA.Keys.F);
            G = AddKey(XNA.Keys.G);
            H = AddKey(XNA.Keys.H);
            I = AddKey(XNA.Keys.I);
            J = AddKey(XNA.Keys.J);
            K = AddKey(XNA.Keys.K);
            L = AddKey(XNA.Keys.L);
            M = AddKey(XNA.Keys.M);
            N = AddKey(XNA.Keys.N);
            O = AddKey(XNA.Keys.O);
            P = AddKey(XNA.Keys.P);
            Q = AddKey(XNA.Keys.Q);
            R = AddKey(XNA.Keys.R);
            S = AddKey(XNA.Keys.S);
            T = AddKey(XNA.Keys.T);
            U = AddKey(XNA.Keys.U);
            V = AddKey(XNA.Keys.V);
            W = AddKey(XNA.Keys.W);
            X = AddKey(XNA.Keys.X);
            Y = AddKey(XNA.Keys.Y);
            Z = AddKey(XNA.Keys.Z);

            Num0 = AddKey(XNA.Keys.D0);
            Num1 = AddKey(XNA.Keys.D1);
            Num2 = AddKey(XNA.Keys.D2);
            Num3 = AddKey(XNA.Keys.D3);
            Num4 = AddKey(XNA.Keys.D4);
            Num5 = AddKey(XNA.Keys.D5);
            Num6 = AddKey(XNA.Keys.D6);
            Num7 = AddKey(XNA.Keys.D7);
            Num8 = AddKey(XNA.Keys.D8);
            Num9 = AddKey(XNA.Keys.D9);

            Escape    = AddKey(XNA.Keys.Escape);
            LControl  = AddKey(XNA.Keys.LeftControl);
            LShift    = AddKey(XNA.Keys.LeftShift);
            LAlt      = AddKey(XNA.Keys.LeftAlt);
            LSystem   = AddKey(XNA.Keys.LeftWindows);
            RControl  = AddKey(XNA.Keys.RightControl);
            RShift    = AddKey(XNA.Keys.RightShift);
            RAlt      = AddKey(XNA.Keys.RightAlt);
            RSystem   = AddKey(XNA.Keys.RightWindows);
            Menu      = AddKey(XNA.Keys.Apps);
            LBracket  = AddKey(XNA.Keys.OemOpenBrackets);
            RBracket  = AddKey(XNA.Keys.OemCloseBrackets);
            SemiColon = AddKey(XNA.Keys.OemSemicolon);
            Comma     = AddKey(XNA.Keys.OemComma);
            Period    = AddKey(XNA.Keys.OemPeriod);
            Quote     = AddKey(XNA.Keys.OemQuotes);
            Question  = AddKey(XNA.Keys.OemQuestion);
            Pipe      = AddKey(XNA.Keys.OemPipe);
            Tilde     = AddKey(XNA.Keys.OemTilde);
            Equal     = AddKey(XNA.Keys.OemPlus);
            Dash      = AddKey(XNA.Keys.OemMinus);
            Space     = AddKey(XNA.Keys.Space);
            Return    = AddKey(XNA.Keys.Enter);
            BackSpace = AddKey(XNA.Keys.Back);
            Tab       = AddKey(XNA.Keys.Tab);

            PageUp   = AddKey(XNA.Keys.PageUp);
            PageDown = AddKey(XNA.Keys.PageDown);
            End      = AddKey(XNA.Keys.End);
            Home     = AddKey(XNA.Keys.Home);
            Insert   = AddKey(XNA.Keys.Insert);
            Delete   = AddKey(XNA.Keys.Delete);

            KeypadPlus     = AddKey(XNA.Keys.OemPlus);
            KeypadMinus    = AddKey(XNA.Keys.OemMinus);
            KeypadMultiply = AddKey(XNA.Keys.Multiply);
            KeypadDivide   = AddKey(XNA.Keys.Divide);

            Left  = AddKey(XNA.Keys.Left);
            Right = AddKey(XNA.Keys.Right);
            Up    = AddKey(XNA.Keys.Up);
            Down  = AddKey(XNA.Keys.Down);

            Keypad0 = AddKey(XNA.Keys.NumPad0);
            Keypad1 = AddKey(XNA.Keys.NumPad1);
            Keypad2 = AddKey(XNA.Keys.NumPad2);
            Keypad3 = AddKey(XNA.Keys.NumPad3);
            Keypad4 = AddKey(XNA.Keys.NumPad4);
            Keypad5 = AddKey(XNA.Keys.NumPad5);
            Keypad6 = AddKey(XNA.Keys.NumPad6);
            Keypad7 = AddKey(XNA.Keys.NumPad7);
            Keypad8 = AddKey(XNA.Keys.NumPad8);
            Keypad9 = AddKey(XNA.Keys.NumPad9);

            F1  = AddKey(XNA.Keys.F1);
            F2  = AddKey(XNA.Keys.F2);
            F3  = AddKey(XNA.Keys.F3);
            F4  = AddKey(XNA.Keys.F4);
            F5  = AddKey(XNA.Keys.F5);
            F6  = AddKey(XNA.Keys.F6);
            F7  = AddKey(XNA.Keys.F7);
            F8  = AddKey(XNA.Keys.F8);
            F9  = AddKey(XNA.Keys.F9);
            F10 = AddKey(XNA.Keys.F10);
            F11 = AddKey(XNA.Keys.F11);
            F12 = AddKey(XNA.Keys.F12);
            F13 = AddKey(XNA.Keys.F13);
            F14 = AddKey(XNA.Keys.F14);
            F15 = AddKey(XNA.Keys.F15);

            Pause  = AddKey(XNA.Keys.Pause);
            Escape = AddKey(XNA.Keys.Escape);

            _any = new AnyButton(allKeys.ToArray()); // copy so we don't loop Any back in
            Last = None = new Button();
            allKeys.Add(Any);

            Control = new AnyButton(LControl, RControl);
            Shift   = new AnyButton(LShift, RShift);
            Alt     = new AnyButton(RAlt, LAlt);
        }