You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 30, 2018. It is now read-only.
Add this to EntityManager.cs public virtual void SuppressDeletion<TComponent>(Entity entity, TComponent component) where TComponent : IComponent { _deletableComponents.RemoveWhere(m => m.entity == entity && m.componentArray.ComponentType == typeof(TComponent)); }
and in ComponentWrapper.cs:
if (gameObjectEntity.EntityManager.HasComponent<TComponent>(gameObjectEntity.Entity)) { _component = gameObjectEntity.GetComponentFromEntityManager<TComponent>(); gameObjectEntity.EntityManager.SuppressDeletion(gameObjectEntity.Entity, _component); // add me } else { gameObjectEntity.EntityManager.AddComponent(gameObjectEntity.Entity, _component); }
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Components get removed when you call the following code in a single frame on a GameObjectEntity:
gameObject.SetActive(true); gameObject.SetActive(false); gameObject.SetActive(true);
The gameobject stays active but its components and monobehaviours get removed.
The text was updated successfully, but these errors were encountered: