- Home /
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!
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?
-
If I can decode this: you're asking about "Include Dependancies" when you try to export a package
exactly!
-
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
Your answer
Follow this Question
Related Questions
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