Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 RJoshField · Oct 20, 2017 at 09:28 PM · scripting problemvisual studioinheritance

Visual Studio doesn't recognize other classes in the same folder?

All of my scripts are in Assets -> __Scripts
I have a class, "N_Analyze" and a class that is attempting to extend it, "N_Gradient" and my main class "Wor_Proj"

So "N_Gradient" has a line that says

public class N_Gradient : N_Analyze

However, in Visual Studio "N_Analyze" doesn't change color, as if the class isn't recognized. Then, when I try to use "N_Gradient" as a type in "Wor_Proj" I get an error telling me that the type or namespace isn't recognized. I'm not using any special namespaces, and all of these scripts are in the same folder in the Project folder. It checks out fine in MonoDevelop, but I'd rather use Visual Studio. Also the Assets folders are in the solution, so I have no idea why it won't recognize them. I've cleaned, rebuilt, rebooted, and it still doesn't recognize these classes. Any advice?

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
1
Best Answer

Answer by MaxGuernseyIII · Oct 20, 2017 at 09:40 PM

Depending on how you are using it Visual Studio may or may not automatically find files just because they happen to be in a specific folder. It's silly but there it is.

Some kinds of projects automatically find everything. Other kinds of projects require that you explicitly include files into those projects. .NET Framework projects are an example of that.

The weird thing that gets generated by Unity that looks and smells like a project behaves in a strange fashion. It wants files to be explicitly included but your Unity editor, which is what generates that project, will do that automatically under certain circumstances. Since I almost never use that functionality, I am not sure what they are but I'm certain that closing Visual Studio and double-clicking on a script causes the csproj to be re-generated. I think even double-clicking on a script from Unity while Visual Studio is open will work, too.

I don't like that integration very much. I manage my own assemblies in Visual Studio. I set them to build to Assets\bin and then, pretty much, forget about the Unity integration unless I have to pop open a debugger. The integration still works when you need to do that but you don't labor under its yolk when you don't need it.

Comment
Add comment · Show 1 · 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 RJoshField · Oct 20, 2017 at 09:47 PM 1
Share

I switched Unity back to using Visual Studio and opened N_Gradient. All of the errors are fixed. Thank you very much!

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.

Follow this Question

Answers Answers and Comments

171 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 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

Why aren't my scripts updating in my project? 1 Answer

Protected variable is assigned in parent but null in child 1 Answer

unity visual studios not working properly 0 Answers

Visual Studio can't reference to Firstpass assembly 4 Answers

2 error messages i can't seem to fix (CS0101 and CS0111) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges