Example #1
0
 protected void ComponentRemoved(ComponentRemoved <UnityGameObject> args)
 {
     if (args.handle.component.gameObject != null)
     {
         UnityEngine.Object.DestroyImmediate(args.handle.component.gameObject);
     }
 }
Example #2
0
 protected void ParentRemoved(ComponentRemoved <Parent> args)
 {
     foreach (Entity child in args.handle.component.children)
     {
         world.RemoveEntity(child);
     }
 }
Example #3
0
        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;
            }
        }
Example #4
0
 protected void BlackAndWhiteComponentRemoved(ComponentRemoved <BlackAndWhiteImageEffect> args)
 {
     world.eventManager.RemoveListener <ImageEffectArgs>(BlackAndWhiteEffect);
 }