Exemple #1
0
        private CompoundChild GetChild(CompoundChildData data, int index)
        {
            var instance = data.Entry.Shape.GetCollidableInstance();

            if (data.Events != null)
            {
                instance.Events = data.Events;
            }
            //Establish the link between the child event manager and our event manager.
            instance.events.Parent = Events;

            if (data.CollisionRules != null)
            {
                instance.CollisionRules = data.CollisionRules;
            }

            instance.Tag = data.Tag;

            if (data.Material == null)
            {
                data.Material = new Material();
            }

            return(new CompoundChild(Shape, instance, data.Material, index));
        }
 private CompoundChild GetChild(CompoundChildData data, int index)
 {
     var instance = data.Entry.Shape.GetCollidableInstance();
     if (data.Events != null)
         instance.events = data.Events;
     if (data.CollisionRules != null)
         instance.collisionRules = data.CollisionRules;
     instance.Tag = data.Tag;
     if (data.Material == null)
         data.Material = new Material();
     return new CompoundChild(Shape, instance, data.Material, index);
 }
        private CompoundChild GetChild(CompoundChildData data, int index)
        {
            var instance = data.Entry.Shape.GetCollidableInstance();

            if (data.Events != null)
            {
                instance.events = data.Events;
            }
            if (data.CollisionRules != null)
            {
                instance.collisionRules = data.CollisionRules;
            }
            instance.Tag = data.Tag;
            if (data.Material == null)
            {
                data.Material = new Material();
            }
            return(new CompoundChild(Shape, instance, data.Material, index));
        }
Exemple #4
0
        private CompoundChild GetChild(CompoundChildData data, int index)
        {
            var instance = data.Entry.Shape.GetCollidableInstance();

            if (data.Events != null)
                instance.Events = data.Events;
            //Establish the link between the child event manager and our event manager.
            instance.events.Parent = Events;

            if (data.CollisionRules != null)
                instance.CollisionRules = data.CollisionRules;

            instance.Tag = data.Tag;

            if (data.Material == null)
                data.Material = new Material();

            return new CompoundChild(Shape, instance, data.Material, index);
        }