Showing posts with label Unity2d. Show all posts
Showing posts with label Unity2d. Show all posts

Friday, 20 October 2017

Unity AdMob (Google Mobile Ads ) Unity Plugin Integration


---- Watch Video Tutorials ----
Admob Integration Tutorial :
https://youtu.be/8wGXcEOYOig
-------------------------------
How To Fix AdMob Problem
https://youtu.be/JRGd7UG-WdE
------------------------------

using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
using System;
 
public class AdManager : MonoBehaviour
{
 
    //THE SCRIPT HAS ORIGNAL ID'S OF ADMOB
    InterstitialAd interstitial;
    BannerView bannerView;
    // Use this for initialization
    void Start()
    {
 
        RequestBanner();
        RequestInterstitial();
    }
 
 
    public void RequestBanner()
    {
   // replace this id with your orignal admob id for banner ad
        string adUnitId = "ca-app-pub-3940256099942544/6300978111";
 
        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
        bannerView.OnAdLoaded += HandleOnAdLoaded;
 
    }
 
    void HandleOnAdLoaded(object a, EventArgs args)
    {
        print("loaded");
        bannerView.Show();
    }
 
 
    public void RequestInterstitial()
    {
 
        string adUnitId = "your interstial ad id here";
 
 
        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
 
 
    }
 
    public void show()
    {
        if (interstitial.IsLoaded())
        {
            interstitial.Show();
        }
    }
 
 
}

Monday, 16 October 2017

Unity 2D Infinite Background Scrolling Simplest Way

Watch Video Tutorial
Code for Infinite Background Scrolling IN Unity 2d game.

using UnityEngine;
using System.Collections;
 
public class Scroll : MonoBehaviour
{
 
    public float backGroundSize;
 
    private Transform cameraTransform;
    public Transform[] layers;
 
    private float viewZone = 0;
    private int leftIndex;
    private int rightIndex;
 
    private void Start()
    {
        cameraTransform = Camera.main.transform;   
 
        leftIndex = 0;
        rightIndex = layers.Length - 1;
    }
 
    void Update()
    {
        if (cameraTransform.position.< 
            (layers[leftIndex].transform.position.+ viewZone))
            ScrollLeft();
 
        if (cameraTransform.position.> 
            (layers[rightIndex].transform.position.- viewZone))
            ScrollRight();
    }
 
    private void ScrollLeft()
    {    
        layers[rightIndex].position = new 
           Vector3
           (1f * (layers[leftIndex].position.- backGroundSize), 0f0f);
        leftIndex = rightIndex;
        rightIndex--;
        if (rightIndex < 0)
            rightIndex = layers.Length - 1;
    }
    private void ScrollRight()
    {   
        layers[leftIndex].position = 
            new Vector3
            (1f * (layers[leftIndex].position.+ backGroundSize), 0f10f);
        rightIndex = leftIndex;
        leftIndex++;
        if (leftIndex == layers.Length)
            leftIndex = 0;
    }
}

Sunday, 30 April 2017

Unity3D Tutorial in Urdu / Hindi [14]

Tutorial No. 14


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [13]

Tutorial No. 13


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [12]

Tutorial No. 12


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [11]

Tutorial No. 11


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [10]

Tutorial No. 10


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [09]

Tutorial No. 9


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [08]

Tutorial No. 8


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [07]

Tutorial No. 7


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [06]

Tutorial No. 6


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5



Unity3D Tutorial in Urdu / Hindi [05]

Tutorial No. 5


Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14

These tutorials are created with Unity personnel edition V 5.3.5.

Unity Tutorial in Urdu / Hindi [04]

Tutorial No.4

Welcome to unity 3_D video tutorial series in Urdu .

(1) Duration Of Course : 90 MINUTES
(2)Level : Beginners
(3)Total videos :14
these tutorials are created with Unity3d personel edition V 5.3.5