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 /
avatar image
0
Question by jzq740176597 · Jul 28, 2016 at 01:14 PM · script.unity5unity 4

how to get script references by script ?

All the tools or editor-extensions out of box now about the get references of script are all related about the attached object .i.e the references is direct or indirect involved the scripts attach to object in the hireachy .

I just want to know :

Script A refer Script B just in code means or C# language level.Not about the object at all.

 class **A**{
 public void Foo(){
    GetComponent<**B**>().DoSth();
 }
 }

So the Select Dependences of unity is not work in this way!

So any hint will be appreciated!

or link?

Tools or script will be Good !!

Regards!

Comment
Add comment · Show 2
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 Owen-Reynolds · Jul 28, 2016 at 02:47 PM 1
Share

If I can decode this: you're asking about "Include Dependancies" when you try to export a package (or some other place Unity does this, like in a Build)?

In general, Unity can detect dependancies through parent/child, or even links in Inspector slots, but not pure code. For example, if you load an Asset purely in code, Unity can't find it and it needs to be in the Resource folder. Of course, the compiler detects code references to other bits of code.

It would help if you can say what problem you're having. Is Unity missing a dependency for you? Or do you just feel like might be able to, but everything is fine now?

avatar image jzq740176597 Owen-Reynolds · Jul 30, 2016 at 07:56 AM 0
Share
  1. If I can decode this: you're asking about "Include Dependancies" when you try to export a package

exactly!

  1. It would help if you can say what problem you're having...

I just want to export specific C# scripts to unitypackage to be used in another project.

So to guarantee the script works in new project I must select all the depended scripts by it!!

Unity build -in "Include independies" not works as we all know.

And I know about

In general, Unity can detect dependancies through parent/child, or even links in Inspector slots, but not pure code

$$anonymous$$now what I want is to export one script include it's dependencies to used in other project..

How ? ins$$anonymous$$d of check it manually.

thanks anyway

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

"Could not establish a connection with the Unity Package Manager local server process. [...]",Could not establish a connection with the Unity Package Manager local server process. 0 Answers

Point-and-Click Camera movement script 1 Answer

RevMob Script Unity 0 Answers

what cause crash in this code 1 Answer

Only Get Parent Collision, not child 2 Answers


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