Skip to main content
Grammar and punctuation, made question more universal with mention that specific user has 4.6 requirement
Source Link
Gnemlock
  • 5.3k
  • 5
  • 30
  • 60

How do I programmatically change the areaSize variable of aan Area Light object in Unity?

I'm trying to change the areaSize property of aan Area Light object, but it looks like it isn't exposed in the class, itself.

this.light.areaSize = new Vector2(this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)


The documentation says it exists, as an "editor only" property.

Is there any way to programmatically access and change this property, possibly using reflection or serialized properties?

I am using Unity 4.6, if at all relevant.

How do I programmatically change the areaSize variable of a Light object in Unity?

I'm trying to change the areaSize property of a Light object, but it looks like it isn't exposed in the class, itself.

this.light.areaSize = new Vector2(this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)


The documentation says it exists, as an "editor only" property.

Is there any way to programmatically access and change this property, possibly using reflection or serialized properties?

I am using Unity 4.6, if at all relevant.

How do I programmatically change the areaSize variable of an Area Light object in Unity?

I'm trying to change the areaSize property of an Area Light object, but it looks like it isn't exposed in the class, itself.

this.light.areaSize = new Vector2(this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)


The documentation says it exists, as an "editor only" property.

Is there any way to programmatically access and change this property, possibly using reflection or serialized properties?

I am using Unity 4.6, if at all relevant.

Grammar and punctuation, made question more universal with mention that specific user has 4.6 requirement
Source Link
Gnemlock
  • 5.3k
  • 5
  • 30
  • 60

Unity 4.6: Programmatically How do I programmatically change the areaSize variable of Area typea Light object in Unity?

I'm trying to change the areaSizeareaSize property of a LightLight object, but it looks like it isn't exposed in the class, itself.

this.light.areaSize =  new Vector2( this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value ); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)

 

But theThe documentationdocumentation says it exists, as an "editor only" property. 

Is there any way to programmatically access and change this property (possibly, possibly using reflection/serialized or serialized properties)?

I am using Unity 4.6, if at all relevant.

Unity 4.6: Programmatically change areaSize of Area type Light

I'm trying to change the areaSize property of a Light object, but it looks like it isn't exposed in the class itself.

this.light.areaSize = new Vector2( this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value ); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)

But the documentation says it exists, as an "editor only" property. Is there any way to programmatically access and change this property (possibly using reflection/serialized properties)?

How do I programmatically change the areaSize variable of a Light object in Unity?

I'm trying to change the areaSize property of a Light object, but it looks like it isn't exposed in the class, itself.

this.light.areaSize =  new Vector2(this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)

 

The documentation says it exists, as an "editor only" property. 

Is there any way to programmatically access and change this property, possibly using reflection or serialized properties?

I am using Unity 4.6, if at all relevant.

Source Link

Unity 4.6: Programmatically change areaSize of Area type Light

I'm trying to change the areaSize property of a Light object, but it looks like it isn't exposed in the class itself.

this.light.areaSize = new Vector2( this.areaLightWidthSlider.Value, this.areaLightHeightSlider.Value ); 

This code results in the error:

error CS1061: 'UnityEngine.Light' does not contain a definition for 'areaSize' and no extension method 'areaSize' accepting a first argument of type 'UnityEngine.Light' could be found (are you missing a using directive or an assembly reference?)

But the documentation says it exists, as an "editor only" property. Is there any way to programmatically access and change this property (possibly using reflection/serialized properties)?