Skip to content

Instantly share code, notes, and snippets.

@jm991
Created November 30, 2017 03:03
Show Gist options
  • Save jm991/542a9170f5698f744d557f7f725eef5d to your computer and use it in GitHub Desktop.
Save jm991/542a9170f5698f744d557f7f725eef5d to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TextureFormatCheck : MonoBehaviour
{
public Texture2D tex2D;
public Material mat;
// Use this for initialization
void Start()
{
mat = this.GetComponent<MeshRenderer>().material;
}
// Update is called once per frame
void Update()
{
if (tex2D != null)
{
Texture tex = mat.GetTexture("_BumpMap");
// Debug.Log(tex.);
Debug.Log("Format: " + tex2D.format);
this.enabled = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment