Unity Loaded texture during RUNTIME has white or black line

It is because of Texture's alpha is not dilated for the gap.
Details could be found HOWTO-alphamaps

So how to fix it:

  • if it's in your Unity project, just enable this texture's AlphaIsTransparency in Texture Importing Setting inspector.
public static void DilateTexture()
    if (Selection.activeObject == null)
        if (EditorUtility.DisplayDialog("Error Selection", "Select a texture", "OK"))

Read more