Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIEffectBase.OnValidate may be disabled when game running #235

Open
ltccss opened this issue Jan 21, 2021 · 0 comments
Open

UIEffectBase.OnValidate may be disabled when game running #235

ltccss opened this issue Jan 21, 2021 · 0 comments
Assignees

Comments

@ltccss
Copy link

ltccss commented Jan 21, 2021

NOTE: Your issue may already be reported! Please search on the issue tracker before creating one.

Is your feature request related to a problem? Please describe.
I pushed those UI-EFFECT materials into a shared asset bundle, and load all the ui assets via asset bundles (with Unity's dependence system).

Firstly I found the UI-Effect-Transition component doesn't work in mobile phone but it's OK when in Editor(also load assets via AB).

this puzzles me for a long time, and then I find this:

protected override void OnValidate()
{
	base.OnValidate ();

	var mat = GetMaterial();
	if (m_EffectMaterial != mat)
	{
		m_EffectMaterial = mat;
		UnityEditor.EditorUtility.SetDirty(this);
	}

	ModifyMaterial();
	SetVerticesDirty ();
	SetDirty ();
}

It seems when in editor mode, m_EffectMaterial will always be checked.

Otherwise, I stopped OnValidate() temporarily and found that if I turn off the KeyWord "UIEFFECT_SEPARATE" in MaterialResolver, a lot of sub material assets will be generated into one material asset (such as "UI-Effect-Transition"), which causes that the UI EFFECT component(such as UITransitionEffect) fails to find its material when deserialized from bundle.
(It seems a Unity bug about asset bundle system?)
(Sorry for no example project provided, it's rather complicated to make one)

the Unity version is 2018.4.21f1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants