protected void ComponentRemoved(ComponentRemoved <UnityGameObject> args) { if (args.handle.component.gameObject != null) { UnityEngine.Object.DestroyImmediate(args.handle.component.gameObject); } }
protected void ParentRemoved(ComponentRemoved <Parent> args) { foreach (Entity child in args.handle.component.children) { world.RemoveEntity(child); } }
protected void ChildRemoved(ComponentRemoved <Child> args) { ComponentHandle <Parent> parentHandle = world.GetComponent <Parent>(args.handle.component.parent); if (parentHandle != null) { parentHandle.component.children.Remove(args.handle.entity); } ComponentHandle <UnityGameObject> objectHandle = world.GetComponent <UnityGameObject>(args.handle.entity); if (objectHandle != null && objectHandle.component.gameObject != null) { objectHandle.component.gameObject.transform.parent = null; } }
protected void BlackAndWhiteComponentRemoved(ComponentRemoved <BlackAndWhiteImageEffect> args) { world.eventManager.RemoveListener <ImageEffectArgs>(BlackAndWhiteEffect); }