anything obvious wrong with my multi_compile?

Hi, I’m trying to get multi_compiled materials working. I’m having trouble figuring out why it doesn’t seem to be executing the code within my #if block. First, here’s my shader:

http://screencast.com/t/RLM7XR6JE

Here’s what the ‘shaderKeywords’ property of my material looks like:
http://screencast.com/t/Qx1wDMdmvdP
(Note “OCCLUSION_ON” as the sole entry in the list)

However, the code inside my OCCLUSION_ON block doesn’t appear to be executing ( my alpha is at full 1.0). However, if I comment OUT the #if/#endif directives, my meshes look properly faded out. Does anyone see anything obviously wrong with my shader, or how I’m using the #if directive? I’ve tried:

#if OCCLUSION_ON
#ifdef OCCLUSION_ON
#if defined(OCCLUSION_ON)

with no change. Does anyone have any ideas?
Thanks in advance!

I dont know, it looks right, try switching it on and off with this:

using UnityEngine;
using System.Collections;
 
[ExecuteInEditMode]
public class ShaderManager : MonoBehaviour {
 
    // Store the camera
    public Camera cam;
    public Texture2D tex;
 
 
    // Before the object gets rendered
    public void OnWillRenderObject ( ) {
 
        cam = Camera.current;
 
        if( !cam )
            return;
 
        Shader shader = renderer.sharedMaterial.shader;
    }
 
    void OnEnable() {
 
        Shader.EnableKeyword("IS_SIMPLE"); // My custom keyword
    }
 
    void OnDisable() {
 
        Shader.DisableKeyword("IS_SIMPLE"); // My custom keyword
    }
}

i am running this:

#pragma multi_compile  VERSION_ONE VERSION_TWO

 #ifdef  VERSION_ONE
       some maths
 #endif

 #ifdef  VERSION_TWO
      some other maths
 #endif

Yay I think I got it. You have to supply a keyword for every multicompile defined in your shader. It’s not enough to supply

[ “OCCLUSION_ON” ]

you have to do

[ “OCCLUSION_ON”, “FOG_OFF” ]

Unity’s example only contains one keyword (“REDIFY_ON”) so it wasn’t very clear