Inheritance: SuperTiled2Unity.Editor.TiledAssetImporter
示例#1
0
    public void Reconfigure(MapEvent parent, SuperTiled2Unity.Editor.TmxAssetImporter importer)
    {
        @event = GetComponentInParent <MapEvent>();

        var            props = parent.Properties;
        CustomProperty prop;

        if (props.TryGetCustomProperty(PropertyItem, out prop))
        {
            itemKey = prop.GetValueAsString();
        }
        if (props.TryGetCustomProperty(PropertyVisible, out prop))
        {
            isInivisble = prop.GetValueAsString() != "VISIBLE";
        }
        if (props.TryGetCustomProperty(PropertyKeyItem, out prop))
        {
            isKey = prop.GetValueAsString() == "KEY_ITEM";
        }
        if (props.TryGetCustomProperty(PropertyCollectable, out prop))
        {
            isCollectable = true;
            itemKey       = prop.GetValueAsString();
        }
    }
示例#2
0
    public void Reconfigure(MapEvent parent, SuperTiled2Unity.Editor.TmxAssetImporter importer)
    {
        collider = parent.GetComponent <PolygonCollider2D>();
        renderer = GetComponent <MeshRenderer>();
        filter   = GetComponent <MeshFilter>();
        @event   = parent.GetComponent <MapEvent>();

        var            props = parent.Properties;
        CustomProperty prop;

        if (props.TryGetCustomProperty(PropertyTileId, out prop))
        {
            tileId = prop.GetValueAsInt();
        }
        else
        {
            Debug.LogError("Bad ceiling " + parent);
        }
        if (props.TryGetCustomProperty(PropertyTileset, out prop))
        {
            var tilesetName = prop.GetValueAsString();
            var path        = TilesetDirectory + "/" + tilesetName + ".png";
            tilesetTexture = AssetDatabase.LoadAssetAtPath <Texture>(path);
        }
        else
        {
            Debug.LogError("Bad ceiling " + parent);
        }

        RecalculateUVs();
        renderer.material = GameboyMaterialSettings.GetDefault().BackgroundMaterial;

        RecalculateMesh(importer);
    }
示例#3
0
    public void Reconfigure(MapEvent parent, SuperTiled2Unity.Editor.TmxAssetImporter importer)
    {
        var props = parent.Properties;

        if (props.TryGetCustomProperty(PropertyKeyItem, out CustomProperty prop))
        {
            itemKey = prop.GetValueAsString();
        }
    }
示例#4
0
    public void RecalculateMesh(SuperTiled2Unity.Editor.TmxAssetImporter importer = null)
    {
        var mesh = RecalculateMesh(ContainsTile);

        if (importer != null)
        {
            var meshName = "Ceiling mesh " + @event.Position.x + "," + @event.Position.y;
            mesh.name = meshName;
            importer.SuperImportContext.AddObjectToAsset(meshName, mesh);
        }
    }