コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            double dur, btime;
            bool   doAn = true;

            if (!double.TryParse(TB_Duration.Text, out dur))
            {
                doAn             = false;
                TB_Duration.Text = "1";
            }

            if (!double.TryParse(TB_Time.Text, out btime))
            {
                doAn         = false;
                TB_Time.Text = "0";
            }

            if (doAn)
            {
                if (Edit)
                {
                    animation_Position.Time               = dur;
                    animation_Position.FromSec            = btime;
                    animation_Position.opacity            = (SL_ToOP.Value / 100);
                    animation_Position.Repeat             = (CB_Repeat.IsChecked == true);
                    animation_Position.Reverse            = (CB_Reverse.IsChecked == true);
                    animation_Position.DoAnimationOnStart = (CB_OnStart.IsChecked == true);
                }
                else
                {
                    AddAnimation?.Invoke(new Animation_Opacity(id, CB_OnStart.IsChecked == true, (SL_ToOP.Value / 100), dur, btime, (CB_Repeat.IsChecked == true), (CB_Reverse.IsChecked == true)));
                }
            }
        }
コード例 #2
0
    public void onFileOpen()
    {
        OpenFileDialog ofDialog = new OpenFileDialog();

        // デフォルトのフォルダを指定する
        //ofDialog.InitialDirectory = @"A:";

        //ofDialog.FileName = "A:";
        ofDialog.FileName = "A:\\3Dmodel\\VRM\\AliciaSolid.vrm";;

        //csvファイルを開くことを指定する
        ofDialog.Filter = "vrmファイル|*.vrm";

        //ダイアログのタイトルを指定する
        ofDialog.Title = "VRMファイルを開け!!!!!";

        //ダイアログを表示する
        if (ofDialog.ShowDialog() == DialogResult.OK)
        {
            var path = ofDialog.FileName;

            StartCoroutine(LoadVrmCoroutine(path, go =>       ///VRM読み込む
            {
                go.transform.position = new Vector3(0, 0, 0); ///位置指定

                var addAnimation = new AddAnimation();        ///Animator付ける(別スクリプト参照
                addAnimation.AddAnimationController(go);
            }));
        }
        else
        {
            Console.WriteLine("キャンセルされました");
        }

        // オブジェクトを破棄する
        ofDialog.Dispose();
    }
コード例 #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            double x, y, dx, dy;
            bool   doAn = true;
            double Btx, Bty;

            if (!double.TryParse(TB_W.Text, out x))
            {
                doAn      = false;
                TB_W.Text = "0";
            }

            if (!double.TryParse(TB_H.Text, out y))
            {
                doAn      = false;
                TB_H.Text = "0";
            }

            if (!double.TryParse(TB_XD.Text, out dx))
            {
                doAn       = false;
                TB_XD.Text = "0";
            }

            if (!double.TryParse(TB_YD.Text, out dy))
            {
                doAn       = false;
                TB_YD.Text = "0";
            }

            if (!double.TryParse(TB_TimeX.Text, out Btx))
            {
                doAn          = false;
                TB_TimeX.Text = "0";
            }

            if (!double.TryParse(TB_TimeY.Text, out Bty))
            {
                doAn          = false;
                TB_TimeY.Text = "0";
            }

            if (doAn)
            {
                if (Edit)
                {
                    animation.MX                 = CB_X.IsChecked == true;
                    animation.MY                 = CB_Y.IsChecked == true;
                    animation.TimeX              = dx;
                    animation.TimeY              = dy;
                    animation.ToX                = x;
                    animation.ToY                = y;
                    animation.accX               = (SL_XAR.Value / 100);
                    animation.accY               = (SL_YAR.Value / 100);
                    animation.decX               = (SL_XDR.Value / 100);
                    animation.decY               = (SL_YDR.Value / 100);
                    animation.BTimeX             = Btx;
                    animation.BTimeY             = Bty;
                    animation.Repeat             = CB_Repeat.IsChecked == true;
                    animation.Reverse            = CB_Reverse.IsChecked == true;
                    animation.DoAnimationOnStart = (CB_OnStart.IsChecked == true);
                }
                else
                {
                    AddAnimation?.Invoke(new Animation_Size(id, CB_OnStart.IsChecked == true, CB_X.IsChecked == true, CB_Y.IsChecked == true,
                                                            x, y, dx, dy, (SL_XAR.Value / 100), (SL_YAR.Value / 100), (SL_XDR.Value / 100), (SL_YDR.Value / 100), Btx, Bty, (CB_Repeat.IsChecked == true), (CB_Reverse.IsChecked == true)));
                }
            }
        }