How to import Normal map at Runtime in Unity 5?

For my project, I need to create materials at run time. When I create material, Normal map has no effect. I tried the two solutions about this but they did not work for me. Is something has changed about this in Unity 5 ?

The Links I checked :

Runtime loading normal texture - Questions & Answers - Unity Discussions Runtime Normal Map Import - Unity Answers

P.S: The weird thing is when I switch to “Scene View” inside Unity, If I expand material tab from “Inspector” Normal Map is being applied to the object.

My Code:

Material mat = new Material(Shader.Find("Standard (Specular setup)"));
mat.SetTexture("_MainTex", colortex);

//For source texture I both tried to use a file from external path and from 
//Resources path which the image file marked as "Normal map".Result did not changed.

normaltex = getNormalTexture(source);
mat.SetTexture("_BumpMap", normaltex);
mat.SetFloat("_Glossiness", 0.1f);
mat.SetFloat("_BumpScale", 1.0f);


public static Texture2D getNormalTexture(Texture2D source)
    Texture2D normalTexture = new Texture2D(source.width, source.height, TextureFormat.ARGB32, true);
    Color theColour = new Color();
    for (int x = 0; x < source.width; x++)
        for (int y = 0; y < source.height; y++)
            theColour.r = 0;
            theColour.g = source.GetPixel(x, y).g;
            theColour.b = 0;
            theColour.a = source.GetPixel(x, y).r;
            normalTexture.SetPixel(x, y, theColour);
    return normalTexture;

hello thankyou for your code. This code works perfectly on mac and windows. But on iOS normal map is not created properly. As you can see in screenshot. As i switch platform from iOS to pc it comes properly. Please see the screenshot for reference. Please help me in this case.alt text96347-iosnormalproblem.png