Version: Unity 6.5 Beta (6000.5)
LanguageEnglish
  • C#

IStyle.Clear

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void Clear(bool clearSourceAssetStyles);

Parameters

Parameter Description
clearSourceAssetStyles Indicates if the inline style properties coming from the source asset must also be cleared for the element.

Description

Clears inline style properties of the element.



After clearing, the style properties of the element revert to the values defined in stylesheets or default values.

By default, this method clears all inline style properties, including those coming from the source asset from which the element was created. To preserve these properties, set the to false.

The following example compares this method and resetting style properties individually.