My code is as follows:
Public Dropdown can av;
Public GameObject go;
Public void the Start ()
{
//-- -- -- -- -- -- -- -- -- -- - (1)
Go=GameObject. Find (" AngelView ");
Av=go. GetComponent
The Debug Log (av);
}
Go to print out of it is not Null Null values, is a DropDown can but I think GetComponent, av, is empty,
I tried for Setting the Menu first, then get GetComponent, av is as empty,
The following is my Hierarchy
![](https://img.codepudding.com/202009/107341261619061.png)
The Setting Menu is the most began to Create the Empty of DropDown can and AngelView are DropDown can object, but I just want AngelView,
Ask how to solve this problem
CodePudding user response:
Capture a full screen to see itCodePudding user response:
Av=go. GetComponentCodePudding user response:
GameObject. GetComponentCodePudding user response:
Dropdown can Dropdown can=FindObjectOfTypeIf (dropdown can!=null)
{
String STR=dropdown can. ItemText. Text;
}