Exemplo n.º 1
0
        public IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false)
        {
            yield return(CollisionShape0.FetchDependency(file, isLog, () => nameof(TriggerModule), "collisionShape0"));

            yield return(CollisionShape1.FetchDependency(file, isLog, () => nameof(TriggerModule), "collisionShape1"));

            yield return(CollisionShape2.FetchDependency(file, isLog, () => nameof(TriggerModule), "collisionShape2"));

            yield return(CollisionShape3.FetchDependency(file, isLog, () => nameof(TriggerModule), "collisionShape3"));

            yield return(CollisionShape4.FetchDependency(file, isLog, () => nameof(TriggerModule), "collisionShape4"));

            yield return(CollisionShape5.FetchDependency(file, isLog, () => nameof(TriggerModule), "collisionShape5"));
        }
Exemplo n.º 2
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            CollisionShape0.Read(stream);
            CollisionShape1.Read(stream);
            CollisionShape2.Read(stream);
            CollisionShape3.Read(stream);
            CollisionShape4.Read(stream);
            CollisionShape5.Read(stream);
            Inside      = stream.ReadInt32();
            Outside     = stream.ReadInt32();
            Enter       = stream.ReadInt32();
            Exit        = stream.ReadInt32();
            RadiusScale = stream.ReadSingle();
        }
Exemplo n.º 3
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            CollisionShape0.Read(reader);
            CollisionShape1.Read(reader);
            CollisionShape2.Read(reader);
            CollisionShape3.Read(reader);
            CollisionShape4.Read(reader);
            CollisionShape5.Read(reader);
            Inside      = (TriggerAction)reader.ReadInt32();
            Outside     = (TriggerAction)reader.ReadInt32();
            Enter       = (TriggerAction)reader.ReadInt32();
            Exit        = (TriggerAction)reader.ReadInt32();
            RadiusScale = reader.ReadSingle();
        }
Exemplo n.º 4
0
    public static bool AreColliding(CollisionShape2 shape1, CollisionShape2 shape2)
    {
        if (shape2.shapeType < shape1.shapeType)
        {
            CollisionShape2 temp = shape1;
            shape2 = shape1;
            shape1 = temp;
        }

        if (shape1.shapeType == CollisionShape2.Shape.EMPTY)
        {
            return(false);
        }

        throw new NotImplementedException("No implementation to compare " + shape1.shapeType + " and " + shape2.shapeType);
    }
Exemplo n.º 5
0
        public override YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(container);

            node.Add("collisionShape0", CollisionShape0.ExportYAML(container));
            node.Add("collisionShape1", CollisionShape1.ExportYAML(container));
            node.Add("collisionShape2", CollisionShape2.ExportYAML(container));
            node.Add("collisionShape3", CollisionShape3.ExportYAML(container));
            node.Add("collisionShape4", CollisionShape4.ExportYAML(container));
            node.Add("collisionShape5", CollisionShape5.ExportYAML(container));
            node.Add("inside", (int)Inside);
            node.Add("outside", (int)Outside);
            node.Add("enter", (int)Enter);
            node.Add("exit", (int)Exit);
            node.Add("radiusScale", RadiusScale);
            return(node);
        }
Exemplo n.º 6
0
        public override YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(container);

            node.Add(CollisionShape0Name, CollisionShape0.ExportYAML(container));
            node.Add(CollisionShape1Name, CollisionShape1.ExportYAML(container));
            node.Add(CollisionShape2Name, CollisionShape2.ExportYAML(container));
            node.Add(CollisionShape3Name, CollisionShape3.ExportYAML(container));
            node.Add(CollisionShape4Name, CollisionShape4.ExportYAML(container));
            node.Add(CollisionShape5Name, CollisionShape5.ExportYAML(container));
            node.Add(InsideName, (int)Inside);
            node.Add(OutsideName, (int)Outside);
            node.Add(EnterName, (int)Enter);
            node.Add(ExitName, (int)Exit);
            node.Add(RadiusScaleName, RadiusScale);
            return(node);
        }
Exemplo n.º 7
0
        public override YAMLNode ExportYAML(IAssetsExporter exporter)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(exporter);

            node.Add("collisionShape0", CollisionShape0.ExportYAML(exporter));
            node.Add("collisionShape1", CollisionShape1.ExportYAML(exporter));
            node.Add("collisionShape2", CollisionShape2.ExportYAML(exporter));
            node.Add("collisionShape3", CollisionShape3.ExportYAML(exporter));
            node.Add("collisionShape4", CollisionShape4.ExportYAML(exporter));
            node.Add("collisionShape5", CollisionShape5.ExportYAML(exporter));
            node.Add("inside", Inside);
            node.Add("outside", Outside);
            node.Add("enter", Enter);
            node.Add("exit", Exit);
            node.Add("radiusScale", RadiusScale);
            return(node);
        }
Exemplo n.º 8
0
 public static bool AreColliding(CollisionShape2 shape1, CollisionShape2 shape2)
 {
     return(CollisionLogic2.AreColliding(shape1, shape2));
 }
Exemplo n.º 9
0
 public bool CollidesWith(CollisionShape2 other)
 {
     return(AreColliding(this, other));
 }