• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Mikhail-Sholokhov · Mar 16, 2017 at 06:24 PM · scripting problemscript.script errorhow

error CS0246

Hello! An error appears on the build. The error string - using UnityEditor;

Here's the script:

 using UnityEngine;
 using System.Collections;
 using UnityEditor;
 
 
 [CustomEditor (typeof(VehicleSelect))][CanEditMultipleObjects]
 public class VehicleSelectEditor : Editor
 {
     public override void OnInspectorGUI ()
     {
 
         serializedObject.Update ();
 
         EditorGUILayout.Space ();
 
         GUI.color = Color.green;
         EditorGUILayout.Space ();
         EditorGUILayout.HelpBox ("\n                           Vehicle Select System\n", MessageType.None);
         EditorGUILayout.Space ();
         GUI.color = Color.white;
 
 
 
 
 
 
         EditorGUILayout.HelpBox ("List of the cars", MessageType.None);
 
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("vehicles"),
             new GUIContent ("Vehicles", "Drag youre car prefabs"), true);
 
         EditorGUILayout.Space ();
 
         EditorGUILayout.HelpBox ("Vehicle spawn point", MessageType.None);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("point"),
             new GUIContent ("Spawn Point", "Drag spawn point transform"), true);
         EditorGUILayout.Space ();
 
 
 
         EditorGUILayout.HelpBox ("List of the car prices", MessageType.None);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("Lock"),
             new GUIContent ("Lock Icon", ""), true);
         EditorGUILayout.Space ();
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("LevelNumText"),
             new GUIContent ("Level Unlock Text", ""), true);
         EditorGUILayout.Space ();
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("carsLevels"),
             new GUIContent ("Ech Car LevelUP Need", ""), true);
         EditorGUILayout.Space ();
 
 
         EditorGUILayout.HelpBox ("Icon - Button - Shop", MessageType.None);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("Lock"),
             new GUIContent ("Lock Icon", "Drag lock icon image   "), true);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("Shop"),
             new GUIContent ("Shop Window", "Drag Shop Window image   "), true);
 
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("Buy"),
             new GUIContent ("Buy Button", "Buy Button Object   "), true);
         EditorGUILayout.Space ();
 
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("vehiclePriceText"),
             new GUIContent ("Vehicle Price Text", "Drag Vehicle Price Text   "), true);
         EditorGUILayout.Space ();
 
 
 
         EditorGUILayout.HelpBox ("Main Level Name", MessageType.None);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("levelName"),
             new GUIContent ("Level Name ", "Enter Main Scene Day Mode Name  "), true);
         EditorGUILayout.Space ();
 
         EditorGUILayout.HelpBox ("Loading Window", MessageType.None);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("Loading"),
             new GUIContent ("Loading Object", "Drag Loading GameObject  "), true);
         EditorGUILayout.Space ();
 
         EditorGUILayout.HelpBox ("Customization", MessageType.None);
 
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("mainMenu"),
             new GUIContent ("Main Menu", "Drag RingSport Component  "), true);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("customizeMenu"),
             new GUIContent ("Customize Menu", "Drag RingSport Component  "), true);
         EditorGUILayout.PropertyField (serializedObject.FindProperty ("selectButtons"),
             new GUIContent ("Select Buttons", "Drag RingSport Component  "), true);
 
         serializedObject.ApplyModifiedProperties ();
 
     }
 
 }
 



Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Commoble · Mar 16, 2017 at 06:42 PM

To paraphrase part of your error message

The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)

Your actual error message will tell you the line in your script that this occurred in, as well as which invalid type or namespace you tried to use. Usually this is a spelling error, and it'll typically be highlighted in red in your IDE (e.g. MonoDevelop). Alternatively, you could be missing a using directive.

This is generally one of the simplest errors to fix, so you should be able to figure out what you did wrong just by looking at your error message, and at the line in your script that your error message mentions. Once you've tried this, if you still can't figure it out, we'll need to see the whole error message you got, as the information within it is extremely useful to anyone trying to solve the error (including yourself).

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mikhail-Sholokhov · Mar 16, 2017 at 11:20 PM 0
Share

In my editor does not show an error in the line, the first line of UsingEditor

avatar image Mikhail-Sholokhov · Mar 18, 2017 at 10:41 PM 0
Share

You can give your mail?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

121 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can you delete a MeshCollider?? CAN you delete a MeshCollider? 1 Answer

JavaScript Problem - BCE0043 - Unexpected Token Help 0 Answers

Unity {[(2D)]} RotateAround while jumping 0 Answers

What's wrong with my script? 2 Answers

Error CS0177 - "GameManager does not contain a definition for 'GetPlayer' PLEASE HELP! 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges