Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by vladimirg · Jun 27, 2013 at 06:00 PM · compilation

How to know and control which scripts are compiling?

(Apologies in advance for noob question...)

I have the same C# script in two different places: /Plugins/[PluginSubdirectory] and /Scripts/Other. Regardless of how I ended up like this, how can I know which of them will compile? How can I control it?

Thanks!

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 iwaldrop · Jun 27, 2013 at 06:03 PM

If they're exactly the same class (and in the same namespace) then I don't believe they will compile at all. In fact, you should get an error like the following:

< path to file > error CS0101: The namespace '' already contains a definition for '< class name >'

Comment
Add comment · Show 3 · 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 vladimirg · Jun 27, 2013 at 06:12 PM 0
Share

I'm getting all sorts of warnings, and one runtime error (IOException in a C# build script), but not that one. So either one of the scripts is not being compiled, or the error is being silenced, I think. And they definitely have the same name, and are not enclosed in any namespace. (Can it be that they get implicit namespaces?)

avatar image iwaldrop · Jun 27, 2013 at 06:22 PM 0
Share

The IO Exception from the build script may be co$$anonymous$$g from the fact that the compiler gets confused when it identifies that there are two classes of the same type name in the assembly. Long story short, you'll have to remove one of them. You may need to refactor some code, but it sounds like you're taking something from the plugins directory and trying to make some tweaks to it. You could probably inherit from it ins$$anonymous$$d, and change the accessors to the method(s) that you're trying to replace protected virtual. That would allow you to override them in your inherited class.

avatar image vladimirg · Jul 01, 2013 at 07:35 AM 0
Share

The IOException happens at runtime (from a post-build script). I have removed it, and I'm getting no errors at all. Back to square one...

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

16 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

Related Questions

Notification of shader recompilation ? 2 Answers

Compilation Process 1 Answer

A simple 2D pong game doesn't run 1 Answer

IL2CPP Compiled Application's scripts not working 1 Answer

Calling C# Namespace from Boo 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