Created
February 1, 2016 22:25
-
-
Save s2kw/3380af5f3aa0be45d531 to your computer and use it in GitHub Desktop.
Shaderのアクセス可能な変数を見る for Standard shader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using UnityEditor; | |
using System.Collections.Generic; | |
[ExecuteInEditMode] | |
public class CheckShader: MonoBehaviour | |
{ | |
void OnEnable () | |
{ | |
Shader s = GetComponent<MeshRenderer>().sharedMaterial.shader; | |
List<String> props = new List<String>(); | |
for ( int i = 0; i < ShaderUtil.GetPropertyCount( s ); ++i ) | |
props.Add( ShaderUtil.GetPropertyName( s, i ) ); | |
Debug.Log( String.Join("\n", props.ToArray()) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment