mob-sakai / UIEffect

UIEffect is an effect component for uGUI element in Unity. Let's decorate your UI with effects!
https://github.com/mob-sakai/UIEffect
MIT License
5.62k stars 773 forks source link

About the codes next to AddComponent<UIEffect>(); #198

Closed atkdefender closed 4 years ago

atkdefender commented 4 years ago
void Start()
{
    UIEffect uiEffect = gameObject.AddComponent<UIEffect>();
    uiEffect.effectMode = EffectMode.Sepia; //Error[0]
    uiEffect.effectFactor = 1f;
    uiEffect.effectColor = Color.white;
    uiEffect.colorMode = ColorMode.Fill; //Error[1]
    uiEffect.colorFactor = 1f;
}

//Error[0]: Assets\AddUiEffect.cs(12,9): error CS0200: Property or indexer 'UIEffect.effectMode' cannot be assigned to -- it is read only //Error[1]: Assets\AddUiEffect.cs(15,9): error CS0200: Property or indexer 'UIEffect.colorMode' cannot be assigned to -- it is read only

So the effectMode/colorMode can only be changed in the inspector?

mob-sakai commented 4 years ago

Hi @atkdefender

Yes, they are read only properties. In next release version (v4.0.0), they will be changed with script. :+1:

atkdefender commented 4 years ago

Got it. Thank you for answering. And an awesome asset! I got a UI blur shadow that can use in my game.

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 4.0.0-preview.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: