title: How to make a RUNTIME BUTTON under a RUNTIME GameObject UNITY
body: <p>is there a way we can make a runtime button under a runtime gameobject?i was able to do a runtime gameobject inherited with all the components/materials from UIToolkit.</p>
  
  <p>heres my code:</p>
  
  <pre><code>    public class loadImage : MonoBehaviour
  {
  
      public UIToolkit duplicate_kit;
      public Material material;
      public UIButton b1, b2;
      public MeshFilter meshFilter;
      public MeshRenderer meshRenderer;
      public Mesh _mesh;
  
  
      void initKit()
      {
  
          Material duplicateMaterial = new Material (material.shader);
          duplicateMaterial.CopyPropertiesFromMaterial(material);
          material = duplicateMaterial;
  
          GameObject loadImageToolkit = new GameObject("duplicate_toolkit");
          loadImageToolkit.transform.parent = GameObject.Find("UI").transform;
          loadImageToolkit.layer = LayerMask.NameToLayer("UILayer");
  
  
          duplicate_kit = loadImageToolkit.AddComponent&lt;UIToolkit&gt;() ;
          duplicate_kit.texturePackerConfigName = "friendsImageSheet";
          duplicate_kit.material = duplicateMaterial;
  
          meshRenderer = loadImageToolkit.AddComponent&lt;MeshRenderer&gt;();
          meshRenderer.renderer.material = duplicateMaterial;
  
          meshFilter = loadImageToolkit.AddComponent&lt;MeshFilter&gt;();
          _mesh = meshFilter.mesh;
  
  
      }
  
      void Start()
      {
           initKit();
  
  //       b1 = UIButton.create( duplicate_kit, "FriendsAvatar.png","FriendsAvatar.png",0,0); 
  //       b1.pixelsFromTopLeft ( 60, 0 );
  //       StartCoroutine(getImage(b1));
  
  
           b2 = UIButton.create( duplicate_kit, "FriendsAvatar.png", "FriendsAvatar.png" , 0,0 );
           b2.pixelsFromTopLeft( 120, 0 );
           StartCoroutine(getImage(b2));
  
  
           b1 = UIButton.create( (UIToolkit)GameObject.Find("duplicate_toolkit").GetComponent(typeof(UIToolkit)), "FriendsAvatar.png","FriendsAvatar.png",0,0);   
           b1.pixelsFromTopLeft ( 120, 0 );
           StartCoroutine(getImage(b1));
  
      }
  
      IEnumerator getImage(UIButton uib)
      {      
          WWW imageRequest = new WWW("https://graph.facebook.com/xxxxxxxxx/picture?type=small"); 
          yield return imageRequest;
          Texture tex = imageRequest.texture;
  
          uib.manager.renderer.material.mainTextureScale = new Vector2(18.0f,20.05f);
          uib.manager.renderer.material.mainTexture = tex;
      }
  
  }
  </code></pre>
  
  <p>the main goal is the b2 button should appeared under duplicate_toolkit(Game Object)</p>
  
  <p>its like :</p>
  
  <p>duplicate_toolkit</p>
  
  <blockquote>
    <p>UIButton </p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/k0wrQ.png" alt="enter image description here"></p>