質問編集履歴

2

情報修正

2018/02/10 01:57

投稿

apple_pie
apple_pie

スコア25

test CHANGED
File without changes
test CHANGED
@@ -5,6 +5,8 @@
5
5
  現在Unityにて、テクスチャファイルを選択するための『ファイルを選択』ダイアログを作成しているのですが、ダイアログを開こうとするとエラーが起きます。
6
6
 
7
7
  ちなみに『System.Windows.Forms』は『C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll』をUnity内へインポートして使用しています。
8
+
9
+ なお、.exeとして出力した際にも使用出来るようにしたいのでUnityEditorはおやめください。
8
10
 
9
11
  分かる方いらっしゃいましたらご教授をよろしくお願いいたします。
10
12
 
@@ -32,7 +34,7 @@
32
34
 
33
35
  (wrapper remoting-invoke-with-check) System.Windows.Forms.CommonDialog:ShowDialog ()
34
36
 
35
- Test.OpenTextureFile () (at Assets/Test/Scripts/Test.cs:93)
37
+ Test.OpenTextureFile () (at Assets/Test/Scripts/Test.cs:6)
36
38
 
37
39
  UnityEngine.Events.InvokableCall.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:165)
38
40
 
@@ -54,29 +56,29 @@
54
56
 
55
57
 
56
58
 
57
- ### 該当のソースコード
59
+ ### 該当のソースコード(Test.cs)
58
60
 
59
61
 
60
62
 
61
63
  ```C#
62
64
 
63
- public void OpenTextureFile(){
65
+ 1 public void OpenTextureFile(){
64
66
 
65
- OpenFileDialog ofd = new OpenFileDialog ();
67
+ 2 OpenFileDialog ofd = new OpenFileDialog ();
66
68
 
67
- ofd.InitialDirectory = UnityEngine.Application.dataPath;
69
+ 3 ofd.InitialDirectory = UnityEngine.Application.dataPath;
68
70
 
69
- ofd.Filter = "テクスチャ(*.png)|*.png";
71
+ 4 ofd.Filter = "テクスチャ(*.png)|*.png";
70
72
 
71
- ofd.Title = "テクスチャを選択してください";
73
+ 5 ofd.Title = "テクスチャを選択してください";
72
74
 
73
- if (ofd.ShowDialog () == DialogResult.OK) {
75
+ 6 if (ofd.ShowDialog () == DialogResult.OK) {
74
76
 
75
- Debug.Log (ofd.FileName);
77
+ 7 Debug.Log (ofd.FileName);
76
78
 
77
- }
79
+ 8 }
78
80
 
79
- }
81
+ 9 }
80
82
 
81
83
  ```
82
84
 

1

タイトルを修正しました

2018/02/10 01:57

投稿

apple_pie
apple_pie

スコア25

test CHANGED
@@ -1 +1 @@
1
- UnityでOpenFileDialogを使用するとッシュす
1
+ UnityでOpenFileDialogを使用するとーが起き
test CHANGED
File without changes