Пример #1
0
        public SelectState(Color color, Texture2D title, Texture2D first, Texture2D second, PreSelectState.OnSelectHandler onFirst, PreSelectState.OnSelectHandler onSecond)
        {
            this.color = color;
            this.title = title;
            this.first = first;
            this.second = second;
            this.onFirst = onFirst;
            this.onSecond = onSecond;

            this.game = LinesGame.instance;
            this.lineWidth = 0.5f;

            this.inputManager = new InputManager();
            this.inputManager.OnClick += OnDown;
        }
Пример #2
0
        private void OnDown(InputManager.MouseButton button, Vector2 position)
        {
            if (onSecond == null) {
                onSecond = onFirst;
            } else if (onFirst == null) {
                onFirst = onSecond;
            }

            if (position.Y < Constants.ToScreenHeight(0.5f)) {
                LinesGame.CurrentState = new PreSelectState(color, title, first, second, onFirst, false);
            } else {
                LinesGame.CurrentState = new PreSelectState(color, title, first, second, onSecond, false);
            }
        }