Questions about .cs

im trying to ad some adds to a game into unity.

this is the code that i have, but i want to integrate the banner and the smartwall not like buttons.

and the banner setup down,not in top position. this is the code that i have, i think if i delete {

    if (GUI.Button(new Rect (100, 200, 300, 120), "Top Banner Ads"))
    {

ill just have the banner.

Ill coppy the full code.

THANKS!

using UnityEngine;
using System.Collections;
using System;


public class CallAirpush : MonoBehaviour {
    /*private IntPtr    JavaClass;
    private int     BtnMyAppWall;
    private int     BtnMyIcon;
    private int     BtnBannerAd;
    IntPtr obj_Activity;*/
    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void Update () {

    }

    void OnGUI ()
    {

        if (GUI.Button(new Rect (100, 200, 300, 120), "Top Banner Ads"))
        {
        //  For ads on top of your screen();

            AirScript.startAirBannerAdTop();

        /// For ads on bottom of your screen();
            //AirScript.startAirBannerAdBottom();


        }

        if (GUI.Button(new Rect (100, 350, 300, 120), "Smartwall Ads"))
        {
            AirScript.startAirSmartWallAd();

        }






    }
}

GUI are drawn on 2D screen vectors and not in the 3D world. So the rectangle x,y origin needs to be calculated against the world vectors.

private percentX = 0.5f;
private percenty = 0.5f;

void Start(){
screenPosition = Camera.main.WorldToScreenPoint(transform.position);
screenPosition.y = Screen.height - screenPosition.y;
}

void OnGUI(){
if (GUI.Button(new Rect (screenPosition - 300 * percentX, screenPosition - 120 * percentY, 300, 120), "Smartwall Ads"))
}

there are other ways you can achieve this depending on your criterias.