質問するログイン新規登録

質問編集履歴

1

エラーメッセージ詳細とコードの追加

2017/09/18 06:59

投稿

Tsos
Tsos

スコア6

title CHANGED
@@ -1,1 +1,1 @@
1
- UnityでAndroid用にビルドしようとしてエラーが、出てしまいました。
1
+ UnityでAndroid用にビルドしようとして、UnityEditor.BuildPlayerWindow+BuildMethodException: Build failと、出てしまいました。
body CHANGED
@@ -7,16 +7,74 @@
7
7
  ###発生している問題・エラーメッセージ
8
8
 
9
9
  ```
10
- UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
10
+ UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
11
11
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
12
12
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
13
13
  UnityEditor.HostView:OnGUI()
14
14
 
15
+
16
+ ・Assets/PyroParticles/Demo/DemoScriptEditor.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?
17
+
18
+ ・Assets/PyroParticles/Demo/DemoScriptEditor.cs(9,40): error CS0246: The type or namespace name `Editor' could not be found. Are you missing an assembly reference?
19
+
20
+ ・Assets/PyroParticles/Demo/DemoScriptEditor.cs(13,30): error CS0115: `DigitalRuby.PyroParticles.LightningBoltEditor.OnInspectorGUI()' is marked as an override but no suitable method found to override
21
+
22
+ ・Error building Player because scripts had compiler errors
23
+
15
24
  ```
16
25
 
17
26
  ###該当のソースコード
18
- c#
27
+ using System;
19
28
 
29
+ using UnityEngine;
30
+ using UnityEditor;
31
+
32
+ namespace DigitalRuby.PyroParticles
33
+ {
34
+ [CustomEditor(typeof(DemoScript))]
35
+ public class LightningBoltEditor : Editor
36
+ {
37
+ private Texture2D logo;
38
+
39
+ public override void OnInspectorGUI()
40
+ {
41
+ if (logo == null)
42
+ {
43
+ string[] guids = AssetDatabase.FindAssets("PyroParticlesLogo");
44
+ foreach (string guid in guids)
45
+ {
46
+ string path = AssetDatabase.GUIDToAssetPath(guid);
47
+ logo = AssetDatabase.LoadMainAssetAtPath(path) as Texture2D;
48
+ if (logo != null)
49
+ {
50
+ break;
51
+ }
52
+ }
53
+ }
54
+ if (logo != null)
55
+ {
56
+ const float maxLogoWidth = 430.0f;
57
+ EditorGUILayout.Separator();
58
+ float w = EditorGUIUtility.currentViewWidth;
59
+ Rect r = new Rect();
60
+ r.width = Math.Min(w - 40.0f, maxLogoWidth);
61
+ r.height = r.width / 2.7f;
62
+ Rect r2 = GUILayoutUtility.GetRect(r.width, r.height);
63
+ r.x = ((EditorGUIUtility.currentViewWidth - r.width) * 0.5f) - 4.0f;
64
+ r.y = r2.y;
65
+ GUI.DrawTexture(r, logo, ScaleMode.StretchToFill);
66
+ if (GUI.Button(r, "", new GUIStyle()))
67
+ {
68
+ Application.OpenURL("http://u3d.as/f1c");
69
+ }
70
+ EditorGUILayout.Separator();
71
+ }
72
+
73
+ DrawDefaultInspector();
74
+ }
75
+ }
76
+ }
77
+
20
78
  ###試したこと
21
79
  パッケージネームの変更
22
80
  保存場所の変更