Jump to content

Open Community  ·  102 members

7 Days To Die

Need help with Unity


Aurilath

Recommended Posts

I immediately apologize for my poor English. I hope you agree with me that the collection of equipment in the game is rather scarce. So I decided to try to bring a little joy to the game for myself. Namely, add your model of equipment. Meshfile and textures moved from Blender to Unity and ran into a problem. Yes, I'm new to Unity, but I'm learning. I can't create and package the prefab and assetbundles into a unity3d file. I found a script that creates such a file, but it does not want to work with Unity versions after 2017. I have searched a lot of resources on the internet but have not yet found a solution to this problem. And I need help. Or a hint on how to do it or a link to a resource where I could learn it. Thank you.

 

 

using UnityEngine;
using UnityEditor;
public class ExportAssetBundles
{
[MenuItem("Assets/Build AssetBundle From Selection - Track dependencies")]
static void ExportResource ()
{
// Bring up save panel
string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
if (path.Length != 0)
{
// Build the resource file from the active selection.
Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path,
BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets);
Selection.objects = selection;
}
}
[MenuItem("Assets/Build AssetBundle From Selection - No dependency tracking")]
static void ExportResourceNoTrack ()
{
// Bring up save panel
string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
if (path.Length != 0)
{
// Build the resource file from the active selection.
BuildPipeline.BuildAssetBundle(Selection.activeObject, Selection.objects, path);
}
}
}
Edited by Aurilath
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...