Data which can be used to create a CompoundChild. This data is not itself a child yet; another system will use it as input to construct the children.
        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));
        }
Beispiel #2
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);
        }