Пример #1
0
		public static new void AddTo(Eto.Platform p)
		{
			// Drawing
			p.Add<Bitmap.IHandler>(() => new BitmapHandler());
			p.Add<FontFamily.IHandler>(() => new FontFamilyHandler());
			p.Add<Font.IHandler>(() => new FontHandler());
			p.Add<Fonts.IHandler>(() => new FontsHandler());
			p.Add<Graphics.IHandler>(() => new GraphicsHandler());
			p.Add<GraphicsPath.IHandler>(() => new GraphicsPathHandler());
			p.Add<Icon.IHandler>(() => new IconHandler());
			p.Add<IconFrame.IHandler>(() => new IconFrameHandler());
			p.Add<IndexedBitmap.IHandler>(() => new IndexedBitmapHandler());
			p.Add<Matrix.IHandler>(() => new MatrixHandler());
			p.Add<Pen.IHandler>(() => new PenHandler());
			p.Add<SolidBrush.IHandler>(() => new SolidBrushHandler());
			p.Add<TextureBrush.IHandler>(() => new TextureBrushHandler());
			p.Add<LinearGradientBrush.IHandler>(() => new LinearGradientBrushHandler());
			p.Add<RadialGradientBrush.IHandler>(() => new RadialGradientBrushHandler());

			// Forms.Cells
			p.Add<Drawable.IHandler>(() => new DrawableHandler());

			// Forms.Printing
			p.Add<PrintDocument.IHandler>(() => new PrintDocumentHandler());
		}
Пример #2
0
		public static void AddTo(Eto.Platform p)
		{
			p.Add<Application.IHandler>(() => new TestApplicationHandler());

			// Drawing
			p.Add<Bitmap.IHandler>(() => new TestBitmapHandler());
			p.Add<Font.IHandler>(() => new TestFontHandler()); 
			p.Add<Graphics.IHandler>(() => new TestGraphicsHandler()); 
			p.Add<Matrix.IHandler>(() => new TestMatrixHandler());

			// Cells
			p.Add<TextBoxCell.IHandler>(() => new TestTextBoxCellHandler());

			// Controls
			p.Add<GridView.IHandler>(() => new TestGridViewHandler());
			p.Add<GridColumn.IHandler>(() => new TestGridColumnHandler());
			p.Add<Label.IHandler>(() => new TestLabelHandler());
			p.Add<TextBox.IHandler>(() => new TestTextBoxHandler());
			p.Add<Calendar.IHandler>(() => new TestCalendarHandler());

			p.Add<TableLayout.IHandler>(() => new TestTableLayoutHandler());
			p.Add<Form.IHandler>(() => new TestFormHandler());
			p.Add<Panel.IHandler>(() => new TestPanelHandler());
			p.Add<Drawable.IHandler>(() => new TestDrawableHandler());
		}
Пример #3
0
    /// <summary>
    /// 干支を生成
    /// </summary>
    /// <param name="count">生成する数</param>
    /// <returns></returns>
    private IEnumerator CreateEtos(int count)
    {
        for (int i = 0; i < count; i++)
        {
            // 干支プレファブのクローンを、干支の生成位置に生成
            Eto eto = Instantiate(etoPrefab, etoSetTran, false);

            // 生成された干支の回転情報を設定(色々な角度になるように)
            eto.transform.rotation = Quaternion.AngleAxis(Random.Range(-maxRotateAngle, maxRotateAngle), Vector3.forward);

            // 生成位置をランダムにして落下位置を変化させる
            eto.transform.localPosition = new Vector2(Random.Range(-400.0f, 400.0f), 1400f);

            // ランダムな干支を12種類の中から1つ選択
            int randomValue = Random.Range(0, selectedEtoDataList.Count);

            // 生成された干支の初期設定
            eto.SetUpEto(selectedEtoDataList[randomValue].etoType, selectedEtoDataList[randomValue].sprite);

            // etoListに追加
            etoList.Add(eto);

            // 0.03秒待って次の干支を生成
            yield return(new WaitForSeconds(0.03f));
        }

        // gameStateが準備中のときだけゲームプレイ中に変更
        if (gameState == GameState.Ready)
        {
            gameState = GameState.Play;
        }
    }
Пример #4
0
		public override ToolBarItem GenerateToolBarItem(ActionItem actionItem, Eto.Generator generator, ToolBarTextAlign textAlign)
		{
			var item = base.GenerateToolBarItem (actionItem, generator, textAlign);
			var tb = (NSToolbarItem)item.ControlObject;
			tb.Target = null;
			tb.Action = Selector;
			return item;
		}
Пример #5
0
    /// <summary>
    /// 選択された干支を削除リストに追加
    /// </summary>
    /// <param name="dragEto"></param>
    private void AddEraseEtolList(Eto dragEto)
    {
        // 削除リストにドラッグ中の干支を追加
        eraseEtoList.Add(dragEto);

        // ドラッグ中の干支のアルファ値を0.5fにする(半透明にすることで、選択中であることをユーザーに伝える)
        ChangeEtoAlpha(dragEto, 0.5f);
    }
Пример #6
0
		public override MenuItem GenerateMenuItem(Eto.Generator generator)
		{
			var item = base.GenerateMenuItem(generator) as ImageMenuItem;
			var menuItem = (NSMenuItem)item.ControlObject;
			menuItem.Target = null;
			menuItem.Action = Selector;
			
			return item;
		}
Пример #7
0
		public override void Update(Eto.Drawing.Rectangle rect)
		{
			if (graphics == null)
				return;
			graphicsHandler.PerformDrawing(null, () =>
			{
				Widget.OnPaint(new PaintEventArgs(graphics, rect));
			});
		}
Пример #8
0
		public static void AddTo(Eto.Generator g)
		{
			// Drawing
			g.Add<IBitmap>(() => new TestBitmapHandler());
			g.Add<IFont>(() => new TestFontHandler()); 
			g.Add<IGraphics>(() => new TestGraphicsHandler()); 
			g.Add<IMatrixHandler>(() => new TestMatrixHandler());

			g.Add<IGridView>(() => new TestGridViewHandler());
		}
Пример #9
0
		public Icon GetFileIcon(string fileName, Eto.IO.IconSize size)
		{
			ShellIcon.IconSize iconSize;
			switch (size)
			{
				default:
				case IconSize.Large: iconSize = ShellIcon.IconSize.Large; break;
				case IconSize.Small: iconSize = ShellIcon.IconSize.Small; break;
			}

			SD.Icon icon = ShellIcon.GetFileIcon( fileName, iconSize, false );
			return new Icon(new IconHandler(icon));
		}
Пример #10
0
    /// <summary>
    /// 前の干支に戻った際に削除リストから削除
    /// </summary>
    /// <param name="dragEto"></param>
    private void RemoveEraseEtoList(Eto dragEto)
    {
        // 削除リストから削除
        eraseEtoList.Remove(dragEto);

        // 干支の透明度を元の値(1.0f)に戻す
        ChangeEtoAlpha(dragEto, 1.0f);

        // 干支の「選択中」の情報がtrueの場合
        if (dragEto.isSelected)
        {
            // falseにして選択中ではない状態に戻す
            dragEto.isSelected = false;
        }
    }
Пример #11
0
    /// <summary>
    /// 干支のドラッグをやめた(指を画面から離した)際の処理
    /// </summary>
    private void OnEndDrag()
    {
        // つながっている干支が3つ以上あったら削除する処理にうつる
        if (eraseEtoList.Count >= 3)
        {
            // 選択されている干支を消す
            for (int i = 0; i < eraseEtoList.Count; i++)
            {
                // 干支リストから取り除く
                etoList.Remove(eraseEtoList[i]);

                // 干支を削除
                Destroy(eraseEtoList[i].gameObject);
            }

            // スコアと消した干支の数の加算
            AddScores(currentEtoType, eraseEtoList.Count);

            // 消した干支の数だけ新しい干支をランダムに生成
            StartCoroutine(CreateEtos(eraseEtoList.Count));

            // 削除リストをクリアする
            eraseEtoList.Clear();
        }
        else
        {
            // つながっている干支が2つ以下なら、削除はしない

            // 削除リストから、削除候補であった干支を取り除く
            for (int i = 0; i < eraseEtoList.Count; i++)
            {
                // 各干支の選択中の状態を解除する
                eraseEtoList[i].isSelected = false;

                // 干支の色の透明度を元の透明度に戻す
                ChangeEtoAlpha(eraseEtoList[i], 1.0f);
            }
        }

        // 次回の干支を消す処理のために、各変数の値をnullにする
        firstSelectEto = null;
        lastSelectEto  = null;
        currentEtoType = null;
    }
Пример #12
0
		public Icon GetStaticIcon(Eto.IO.StaticIconType type, Eto.IO.IconSize size)
		{
			ShellIcon.IconSize iconSize;
			switch (size)
			{
				default:
				case IconSize.Large: iconSize = ShellIcon.IconSize.Large; break;
				case IconSize.Small: iconSize = ShellIcon.IconSize.Small; break;
			}

			ShellIcon.FolderType folderType;
			switch (type)
			{
				default:
				case StaticIconType.OpenDirectory: folderType = ShellIcon.FolderType.Open;  break;
				case StaticIconType.CloseDirectory: folderType = ShellIcon.FolderType.Closed;  break;
			}
			
			SD.Icon icon = ShellIcon.GetFolderIcon(iconSize, folderType);
			return new Icon(new IconHandler(icon));
		}
Пример #13
0
    /// <summary>
    /// 干支を最初にドラッグした際の処理
    /// </summary>
    private void OnStartDrag()
    {
        // 画面をタップした際の位置情報を、CameraクラスのScreenToWorldPointメソッドを利用してCanvas上の座標に変換
        RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

        // 干支がつながっている数を初期化
        linkCount = 0;

        // 変換した座標のコライダーを持つゲームオブジェクトがあるか確認
        if (hit.collider != null)
        {
            // ゲームオブジェクトがあった場合、そのゲームオブジェクトがEtoクラスを持っているかどうか確認
            if (hit.collider.gameObject.TryGetComponent(out Eto dragEto))
            {
                // Etoクラスを持っていた場合には、以下の処理を行う

                // 最初にドラッグした干支の情報を変数に代入
                firstSelectEto = dragEto;

                // 最後にドラッグした干支の情報を変数に代入(最初のドラッグなので、最後のドラッグも同じ干支)
                lastSelectEto = dragEto;

                // 最初にドラッグしている干支の種類を代入 = 後ほど、この情報を使ってつながる干支かどうかを判別する
                currentEtoType = dragEto.etoType;

                // 干支の状態が「選択中」であると更新
                dragEto.isSelected = true;

                // 干支に何番目に選択されているのか、通し番号を登録
                dragEto.num = linkCount;

                // 削除する対象の干支を登録するリストを初期化
                eraseEtoList = new List <Eto>();

                // ドラッグ中の干支を削除の対象としてリストに登録
                AddEraseEtolList(dragEto);
            }
        }
    }
Пример #14
0
		public static new void AddTo(Eto.Generator g)
		{
			// Drawing
			g.Add<IBitmap>(() => new BitmapHandler());
			g.Add<IFontFamily>(() => new FontFamilyHandler());
			g.Add<IFont>(() => new FontHandler());
			g.Add<IFonts>(() => new FontsHandler());
			g.Add<IGraphics>(() => new GraphicsHandler());
			g.Add<IGraphicsPathHandler>(() => new GraphicsPathHandler());
			g.Add<IIcon>(() => new IconHandler());
			g.Add<IIndexedBitmap>(() => new IndexedBitmapHandler());
			g.Add<IMatrixHandler>(() => new MatrixHandler());
			g.Add<IPen>(() => new PenHandler());
			g.Add<ISolidBrush>(() => new SolidBrushHandler());
			g.Add<ITextureBrush>(() => new TextureBrushHandler());
			g.Add<ILinearGradientBrush>(() => new LinearGradientBrushHandler());

			// Forms.Cells
			g.Add<IDrawable>(() => new DrawableHandler());

			// Forms.Printing
			g.Add<IPrintDocument>(() => new PrintDocumentHandler());
		}
Пример #15
0
		public static Font ToEto(this sd.Font font, Eto.Generator generator)
		{
			return font == null ? null : new Font(generator, new FontHandler(font));
		}
Пример #16
0
 public static void Main(string[] args)
 {
     new Application(Eto.Platforms.XamMac2).Run(new Tap - Eto.MainForm());
 }
Пример #17
0
		object ISolidBrush.Create (Eto.Drawing.Color color)
		{
			return color.ToCGColor ();
		}
Пример #18
0
		public static Graphics ToEto(this sd.Graphics g, Eto.Generator generator)
		{
			return new Graphics(generator, new GraphicsHandler(g));
		}
Пример #19
0
 private static Payload LogoutReason(Eto.LogoutReason reason)
 {
     return new Payload {
         Type = PayloadType.PAYLOADETO,
         EtoPayload = new Eto.Payload {
             Type = Eto.PayloadType.PAYLOADLOGOUT,
             Logout = new Eto.Logout {
                 Reason = reason
             }
         }
     };
 }
Пример #20
0
		public static PaintEventArgs ToEto(this swf.PaintEventArgs e, Eto.Generator generator)
		{
			return new PaintEventArgs(ToEto(e.Graphics, generator), e.ClipRectangle.ToEto());
		}
Пример #21
0
 /// <summary>
 /// 干支のアルファ値を変更
 /// </summary>
 /// <param name="dragEto"></param>
 /// <param name="alphaValue"></param>
 private void ChangeEtoAlpha(Eto dragEto, float alphaValue)
 {
     // 現在ドラッグしている干支のアルファ値を変更
     dragEto.imgEto.color = new Color(dragEto.imgEto.color.r, dragEto.imgEto.color.g, dragEto.imgEto.color.b, alphaValue);
 }
Пример #22
0
		public static PrintSettings ToEto(this sdp.PrinterSettings settings, Eto.Generator generator)
		{
			return settings == null ? null : new PrintSettings(generator, new PrintSettingsHandler(settings));
		}
Пример #23
0
		public static PrintSettings ToEto(this NSPrintInfo value, Eto.Generator generator)
		{
			return value == null ? null : new PrintSettings(generator, new PrintSettingsHandler(value));
		}
Пример #24
0
		/// <summary>
		/// Initializes a new instance of the TransformStack class
		/// </summary>
		/// <param name="generator">Generator for the stack</param>
		/// <param name="push">A callback that should prepend the specified value to the current matrix </param>
		/// <param name="pop">A callback that should either pop the matrix stack or set the current matrix to the specified value</param>
		public TransformStack (Eto.Generator generator, Action<IMatrix> push, Action pop)
		{
			this.generator = generator;
			this.push = push;
			this.pop = pop;
		}
Пример #25
0
		public static void AddTo(Eto.Generator g)
		{
			// Drawing
			g.Add<IBitmap>(() => new BitmapHandler());
			g.Add<IFontFamily>(() => new FontFamilyHandler());
			g.Add<IFont>(() => new FontHandler());
			g.Add<IFonts>(() => new FontsHandler());
			g.Add<IGraphics>(() => new GraphicsHandler());
			g.Add<IGraphicsPathHandler>(() => new GraphicsPathHandler());
			g.Add<IIcon>(() => new IconHandler());
			g.Add<IIndexedBitmap>(() => new IndexedBitmapHandler());
			g.Add<IMatrixHandler>(() => new MatrixHandler());
			g.Add<IPen>(() => new PenHandler());
			g.Add<ISolidBrush>(() => new SolidBrushHandler());
			g.Add<ITextureBrush>(() => new TextureBrushHandler());
			g.Add<ILinearGradientBrush>(() => new LinearGradientBrushHandler());

			// Forms.Cells
			g.Add<ICheckBoxCell>(() => new CheckBoxCellHandler());
			g.Add<IComboBoxCell>(() => new ComboBoxCellHandler());
			g.Add<IImageTextCell>(() => new ImageTextCellHandler());
			g.Add<IImageViewCell>(() => new ImageViewCellHandler());
			g.Add<ITextBoxCell>(() => new TextBoxCellHandler());
			
			// Forms.Controls
			g.Add<IButton>(() => new ButtonHandler());
			g.Add<ICheckBox>(() => new CheckBoxHandler());
			g.Add<IComboBox>(() => new ComboBoxHandler());
			g.Add<IDateTimePicker>(() => new DateTimePickerHandler());
			g.Add<IDrawable>(() => new DrawableHandler());
			g.Add<IGridColumn>(() => new GridColumnHandler());
			g.Add<IGridView>(() => new GridViewHandler());
			g.Add<IGroupBox>(() => new GroupBoxHandler());
			g.Add<IImageView>(() => new ImageViewHandler());
			g.Add<ILabel>(() => new LabelHandler());
			g.Add<IListBox>(() => new ListBoxHandler());
			g.Add<INumericUpDown>(() => new NumericUpDownHandler());
			g.Add<IPanel>(() => new PanelHandler());
			g.Add<IPasswordBox>(() => new PasswordBoxHandler());
			g.Add<IProgressBar>(() => new ProgressBarHandler());
			g.Add<IRadioButton>(() => new RadioButtonHandler());
			g.Add<ISearchBox>(() => new SearchBoxHandler());
			g.Add<IScrollable>(() => new ScrollableHandler());
			g.Add<ISlider>(() => new SliderHandler());
			g.Add<ISpinner>(() => new ThemedSpinnerHandler());
			g.Add<ISplitter>(() => new SplitterHandler());
			g.Add<ITabControl>(() => new TabControlHandler());
			g.Add<ITabPage>(() => new TabPageHandler());
			g.Add<ITextArea>(() => new TextAreaHandler());
			g.Add<ITextBox>(() => new TextBoxHandler());
			g.Add<ITreeGridView>(() => new TreeGridViewHandler());
			g.Add<ITreeView>(() => new TreeViewHandler());
			//g.Add<IWebView> (() => new WebViewHandler ());
			g.Add<IScreens>(() => new ScreensHandler());
			
			// Forms.Menu
			g.Add<ICheckMenuItem>(() => new CheckMenuItemHandler());
			g.Add<IContextMenu>(() => new ContextMenuHandler());
			g.Add<IButtonMenuItem>(() => new ButtonMenuItemHandler());
			g.Add<IMenuBar>(() => new MenuBarHandler());
			g.Add<IRadioMenuItem>(() => new RadioMenuItemHandler());
			g.Add<ISeparatorMenuItem>(() => new SeparatorMenuItemHandler());
			
			// Forms.Printing
			g.Add<IPrintDialog>(() => new PrintDialogHandler());
			g.Add<IPrintDocument>(() => new PrintDocumentHandler());
			g.Add<IPrintSettings>(() => new PrintSettingsHandler());
			
			// Forms.ToolBar
			g.Add<ICheckToolItem>(() => new CheckToolItemHandler());
			g.Add<ISeparatorToolItem>(() => new SeparatorToolItemHandler());
			g.Add<IButtonToolItem>(() => new ButtonToolItemHandler());
			g.Add<IToolBar>(() => new ToolBarHandler());
			
			// Forms
			g.Add<IApplication>(() => new ApplicationHandler());
			g.Add<IClipboard>(() => new ClipboardHandler());
			g.Add<IColorDialog>(() => new ColorDialogHandler());
			g.Add<ICursor>(() => new CursorHandler());
			g.Add<IDialog>(() => new DialogHandler());
			g.Add<IFontDialog>(() => new FontDialogHandler());
			g.Add<IForm>(() => new FormHandler());
			g.Add<IMessageBox>(() => new MessageBoxHandler());
			g.Add<IOpenFileDialog>(() => new OpenFileDialogHandler());
			g.Add<IPixelLayout>(() => new PixelLayoutHandler());
			g.Add<ISaveFileDialog>(() => new SaveFileDialogHandler());
			g.Add<ISelectFolderDialog>(() => new SelectFolderDialogHandler());
			g.Add<ITableLayout>(() => new TableLayoutHandler());
			g.Add<IUITimer>(() => new UITimerHandler());
			g.Add<IMouse>(() => new MouseHandler());
			
			// IO
			g.Add<ISystemIcons>(() => new SystemIconsHandler());
			
			// General
			g.Add<IEtoEnvironment>(() => new EtoEnvironmentHandler());
		}
Пример #26
0
		public static void AddTo(Eto.Platform p)
		{
			// Drawing
			p.Add<Bitmap.IHandler>(() => new BitmapHandler());
			p.Add<FontFamily.IHandler>(() => new FontFamilyHandler());
			p.Add<Font.IHandler>(() => new FontHandler());
			p.Add<Fonts.IHandler>(() => new FontsHandler());
			p.Add<Graphics.IHandler>(() => new GraphicsHandler());
			p.Add<GraphicsPath.IHandler>(() => new GraphicsPathHandler());
			p.Add<Icon.IHandler>(() => new IconHandler());
			p.Add<IndexedBitmap.IHandler>(() => new IndexedBitmapHandler());
			p.Add<Matrix.IHandler>(() => new MatrixHandler());
			p.Add<Pen.IHandler>(() => new PenHandler());
			p.Add<SolidBrush.IHandler>(() => new SolidBrushHandler());
			p.Add<TextureBrush.IHandler>(() => new TextureBrushHandler());
			p.Add<LinearGradientBrush.IHandler>(() => new LinearGradientBrushHandler());

			// Forms.Cells
			p.Add<CheckBoxCell.IHandler>(() => new CheckBoxCellHandler());
			p.Add<ComboBoxCell.IHandler>(() => new ComboBoxCellHandler());
			p.Add<ImageTextCell.IHandler>(() => new ImageTextCellHandler());
			p.Add<ImageViewCell.IHandler>(() => new ImageViewCellHandler());
			p.Add<TextBoxCell.IHandler>(() => new TextBoxCellHandler());
			p.Add<DrawableCell.IHandler>(() => new DrawableCellHandler());

			// Forms.Controls
			p.Add<Button.IHandler>(() => new ButtonHandler());
			p.Add<Calendar.IHandler>(() => new CalendarHandler());
			p.Add<CheckBox.IHandler>(() => new CheckBoxHandler());
			p.Add<DropDown.IHandler>(() => new DropDownHandler());
			p.Add<ComboBox.IHandler>(() => new ComboBoxHandler());
			p.Add<ColorPicker.IHandler>(() => new ColorPickerHandler());
			p.Add<DateTimePicker.IHandler>(() => new DateTimePickerHandler());
			p.Add<Drawable.IHandler>(() => new DrawableHandler());
			p.Add<GridColumn.IHandler>(() => new GridColumnHandler());
			p.Add<GridView.IHandler>(() => new GridViewHandler());
			p.Add<GroupBox.IHandler>(() => new GroupBoxHandler());
			p.Add<ImageView.IHandler>(() => new ImageViewHandler());
			p.Add<Label.IHandler>(() => new LabelHandler());
			p.Add<LinkButton.IHandler>(() => new LinkButtonHandler());
			p.Add<ListBox.IHandler>(() => new ListBoxHandler());
			p.Add<NumericUpDown.IHandler>(() => new NumericUpDownHandler());
			p.Add<Panel.IHandler>(() => new PanelHandler());
			p.Add<PasswordBox.IHandler>(() => new PasswordBoxHandler());
			p.Add<ProgressBar.IHandler>(() => new ProgressBarHandler());
			p.Add<RadioButton.IHandler>(() => new RadioButtonHandler());
			p.Add<Scrollable.IHandler>(() => new ScrollableHandler());
			p.Add<SearchBox.IHandler>(() => new SearchBoxHandler());
			p.Add<Slider.IHandler>(() => new SliderHandler());
			#if GTK3
			p.Add<Spinner.IHandler>(() => new SpinnerHandler());
			#else
			p.Add<Spinner.IHandler>(() => new ThemedSpinnerHandler());
			#endif
			p.Add<Splitter.IHandler>(() => new SplitterHandler());
			p.Add<TabControl.IHandler>(() => new TabControlHandler());
			p.Add<TabPage.IHandler>(() => new TabPageHandler());
			p.Add<TextArea.IHandler>(() => new TextAreaHandler());
			p.Add<TextBox.IHandler>(() => new TextBoxHandler());
			p.Add<TreeGridView.IHandler>(() => new TreeGridViewHandler());
			p.Add<TreeView.IHandler>(() => new TreeViewHandler());
			p.Add<WebView.IHandler>(() => new WebViewHandler());
			p.Add<Screen.IScreensHandler>(() => new ScreensHandler());
			
			// Forms.Menu
			p.Add<CheckMenuItem.IHandler>(() => new CheckMenuItemHandler());
			p.Add<ContextMenu.IHandler>(() => new ContextMenuHandler());
			p.Add<ButtonMenuItem.IHandler>(() => new ButtonMenuItemHandler());
			p.Add<MenuBar.IHandler>(() => new MenuBarHandler());
			p.Add<RadioMenuItem.IHandler>(() => new RadioMenuItemHandler());
			p.Add<SeparatorMenuItem.IHandler>(() => new SeparatorMenuItemHandler());
			
			// Forms.Printing
			p.Add<PrintDialog.IHandler>(() => new PrintDialogHandler());
			p.Add<PrintDocument.IHandler>(() => new PrintDocumentHandler());
			p.Add<PrintSettings.IHandler>(() => new PrintSettingsHandler());
			
			// Forms.ToolBar
			p.Add<CheckToolItem.IHandler>(() => new CheckToolItemHandler());
			p.Add<RadioToolItem.IHandler>(() => new RadioToolItemHandler());
			p.Add<SeparatorToolItem.IHandler>(() => new SeparatorToolItemHandler());
			p.Add<ButtonToolItem.IHandler>(() => new ButtonToolItemHandler());
			p.Add<ToolBar.IHandler>(() => new ToolBarHandler());

			// Forms
			p.Add<Application.IHandler>(() => new ApplicationHandler());
			p.Add<Clipboard.IHandler>(() => new ClipboardHandler());
			p.Add<ColorDialog.IHandler>(() => new ColorDialogHandler());
			p.Add<Cursor.IHandler>(() => new CursorHandler());
			p.Add<Dialog.IHandler>(() => new DialogHandler());
			p.Add<FontDialog.IHandler>(() => new FontDialogHandler());
			p.Add<Form.IHandler>(() => new FormHandler());
			p.Add<MessageBox.IHandler>(() => new MessageBoxHandler());
			p.Add<OpenFileDialog.IHandler>(() => new OpenFileDialogHandler());
			p.Add<PixelLayout.IHandler>(() => new PixelLayoutHandler());
			p.Add<SaveFileDialog.IHandler>(() => new SaveFileDialogHandler());
			p.Add<SelectFolderDialog.IHandler>(() => new SelectFolderDialogHandler());
			p.Add<TableLayout.IHandler>(() => new TableLayoutHandler());
			p.Add<UITimer.IHandler>(() => new UITimerHandler());
			p.Add<Mouse.IHandler>(() => new MouseHandler());

			// IO
			p.Add<SystemIcons.IHandler>(() => new SystemIconsHandler());

			// General
			p.Add<EtoEnvironment.IHandler>(() => new EtoEnvironmentHandler());
		}
Пример #27
0
    /// <summary>
    /// 干支のドラッグ(スワイプ)中処理
    /// </summary>
    private void OnDragging()
    {
        // OnStartDragメソッドと同じ処理で、指の位置をワールド座標に変換しRayを発射し、その位置にあるコライダーを持つオブジェクトを取得してhit変数へ代入
        RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

        // Rayの戻り値があり(hit変数がnullではない)、hit変数のゲームオブジェクトがEtoクラスを持っていたら
        if (hit.collider != null && hit.collider.gameObject.TryGetComponent(out Eto dragEto))
        {
            // 現在選択中の干支の種類がnullなら処理は行わない
            if (currentEtoType == null)
            {
                return;
            }

            // dragEto変数の干支の種類が最初に選択した干支の種類と同じであり、最後にタップしている干支と現在の干支が違うオブジェクトであり、かつ、現在の干支がすでに「選択中」でなければ
            if (dragEto.etoType == currentEtoType && lastSelectEto != dragEto && !dragEto.isSelected)
            {
                // 現在タップしている干支の位置情報と最後にタップした干支の位置情報と比べて、差分の値(干支通しの距離)を取る
                float distance = Vector2.Distance(dragEto.transform.position, lastSelectEto.transform.position);

                // 干支同士の距離が設定値よりも小さければ(2つの干支が離れていなければ)、干支をつなげる
                if (distance < etoDistance)
                {
                    // 現在の干支を選択中にする
                    dragEto.isSelected = true;

                    // 最後に選択している干支を現在の干支に更新
                    lastSelectEto = dragEto;

                    // 干支のつながった数のカウントを1つ増やす
                    linkCount++;

                    // 干支に通し番号を設定
                    dragEto.num = linkCount;

                    // 削除リストに現在の干支を追加
                    AddEraseEtolList(dragEto);
                }
            }

            // 現在の干支の種類を確認(現在の干支(dragEtoの情報であれば、他の情報でもよい。ちゃんと選択されているかの確認用))
            Debug.Log(dragEto.etoType);

            // 削除リストに2つ以上の干支が追加されている場合
            if (eraseEtoList.Count > 1)
            {
                // 現在の干支の通し番号を確認
                Debug.Log(dragEto.num);

                // 条件に合致する場合、削除リストから干支を除外する(ドラッグしたまま1つ前の干支の戻る場合、現在の干支を削除リストから除外する)
                if (eraseEtoList[linkCount - 1] != lastSelectEto && eraseEtoList[linkCount - 1].num == dragEto.num && dragEto.isSelected)
                {
                    // 選択中のボールを取り除く
                    RemoveEraseEtoList(lastSelectEto);

                    lastSelectEto.GetComponent <Eto>().isSelected = false;

                    // 最後のボールの情報を、前のボールに戻す
                    lastSelectEto = dragEto;

                    // つながっている干支の数を減らす
                    linkCount--;
                }
            }
        }
    }