add gameobject in inspector through custom editor unity code example
Example 1: unity how to change text in script
Text myText = GameObject.Find("Canvas/Text").GetComponent<Text>();
myText.text = "Your text changed!";
Example 2: how to add a componet to a gameobject throgh code unity
//This uses C# and unity
//to add a ridgidbody
gameobject.addComponet<ridgidbody>();
//to add a meshCollider
gameobject.addComponet<MeshCollider>();
//check out my profile