Jump to content

New Moder for A 20.5 - Failed to Add new Sounds - Help Plz


Jager

Recommended Posts

Hello guys

I am trying to create a new modlet for AutoTurret.

I love sentry turrets and robotics and I find whats availiable a bit.. lacking.

I studied the modlets that convert the Turrets to use other types of Ammo, but the fact that the Turret model remains the same throws me off immersion.

So Basically I am starting my own modlet.

The first step is to add new sounds for the turret.

I read the tutorials and created .unity3d bundles, then placed them in the mod's Assets folder and referenced them using

#@modfolder:Resources/JagerSounds4.unity3d?...etc

The problem is in game I get the error :

ERR: Loading Asset Bundle "..." failed.

I tried with many Unity Editor versions but the result is the same.

2019.2.17f1
2020.3.25f1

 

Any Ideas?

Thanks in Advance

 

Link to comment
Share on other sites

Well I am using this one (Not Mine found it in tutorials from other guys) :

 

using UnityEngine;
using UnityEditor;
using UnityEngine.Rendering;

public class MultiPlatformExportAssetBundles
{
    [MenuItem("Assets/Build Multi-Platform AssetBundle From Selection")]
    static void ExportResource()
    {
        // Bring up save panel
        string path = EditorUtility.SaveFilePanel("Save Resource", "", "New Resource", "unity3d");
        if (path.Length != 0)
        {
            
            // include the following Graphic APIs
            PlayerSettings.SetGraphicsAPIs(BuildTarget.StandaloneWindows, new GraphicsDeviceType[] { GraphicsDeviceType.Direct3D11, GraphicsDeviceType.OpenGLCore, GraphicsDeviceType.Vulkan});

            // Build the resource file from the active selection.
            Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);

            #pragma warning disable CS0618 // Type or member is obsolete
            BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.StandaloneWindows);
              Selection.objects = selection;
            #pragma warning restore CS0618 // Type or member is obsolete


        }
    }
}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...