shader properties

I guess this is more of a scripting question than shaderlab one.

I’m trying to change material/shader Reflection Cubemap at runtime in C#.

These are obviously the common ones and are no problem, but don’t correlate to anything directly in the shader.
go.renderer.material.color
go.renderer.material.mainTexture

I just can’t seem to get correct property name for the cube map, or whether I need to dig deeper into Shader structure.

I probably need some sleep! :shock:
Thanks for any help.

Shader "Reflective/Specular" {
	Properties {
		_Color ("Main Color", Color) = (1,1,1,1)
		_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
		_Shininess ("Shininess", Range (0.01, 1)) = 0.078125
		_ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
		_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
		_Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
	}
	SubShader {
		LOD 300
		Tags { "RenderType"="Opaque" }
		UsePass "Reflective/VertexLit/BASE"
		UsePass "Specular/PPL"
	}
	FallBack "Reflective/VertexLit", 1
}

I think the property you’re after is “go.renderer.material._Cube”

I’m trying to do the same kind of thing in js, but getting odd behavior when trying to change (in this case) _Shininess

so my code runs like this:

renderer.material._Shininess = 0.5;

but I get an error message which says “expecting :, found ‘=’.”
There must be something I’m missing here - can anyone tell me what it is?

callahan.44 needs this.

chenjung_407ad needs this.

Both of you just need to familiarize yourself with the “Functions” section.