###前提・実現したいこと
UnityでAndroidのゲームを作っていて、
実行モードではエラーなく最後まで行ったのに、
いざビルドしようとするとエラーが出てしまいました。
###発生している問題・エラーメッセージ
・UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors. at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83 UnityEditor.HostView:OnGUI() ・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? ・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? ・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 ・Error building Player because scripts had compiler errors
###該当のソースコード
using System;
using UnityEngine;
using UnityEditor;
namespace DigitalRuby.PyroParticles
{
[CustomEditor(typeof(DemoScript))]
public class LightningBoltEditor : Editor
{
private Texture2D logo;
public override void OnInspectorGUI() { if (logo == null) { string[] guids = AssetDatabase.FindAssets("PyroParticlesLogo"); foreach (string guid in guids) { string path = AssetDatabase.GUIDToAssetPath(guid); logo = AssetDatabase.LoadMainAssetAtPath(path) as Texture2D; if (logo != null) { break; } } } if (logo != null) { const float maxLogoWidth = 430.0f; EditorGUILayout.Separator(); float w = EditorGUIUtility.currentViewWidth; Rect r = new Rect(); r.width = Math.Min(w - 40.0f, maxLogoWidth); r.height = r.width / 2.7f; Rect r2 = GUILayoutUtility.GetRect(r.width, r.height); r.x = ((EditorGUIUtility.currentViewWidth - r.width) * 0.5f) - 4.0f; r.y = r2.y; GUI.DrawTexture(r, logo, ScaleMode.StretchToFill); if (GUI.Button(r, "", new GUIStyle())) { Application.OpenURL("http://u3d.as/f1c"); } EditorGUILayout.Separator(); } DrawDefaultInspector(); } }
}
###試したこと
パッケージネームの変更
保存場所の変更
###補足情報(言語/FW/ツール等のバージョンなど)
unity
これはエラー文全文ではないですよね?もしそうでしたら入る限り載せていただいた方が良いです。
回答1件
あなたの回答
tips
プレビュー