Code Monkey home page Code Monkey logo

Comments (6)

hiroki-o avatar hiroki-o commented on June 16, 2024

Original comment by Sam Narain (Bitbucket: samnarain, GitHub: samnarain).


@DWSMatt do you mean like when you have Asset A, which normally wouldn't belong to anything, is set to Asset Bundle B on the original Asset A?

from assetgraph.

hiroki-o avatar hiroki-o commented on June 16, 2024

Original comment by Matt D (Bitbucket: DWSMatt, GitHub: DWSMatt).


@samnarain Exactly. It's just so that these assets are not included in the actual shipped binaries and executables of the game.

from assetgraph.

hiroki-o avatar hiroki-o commented on June 16, 2024

Original comment by Hiroki Omae (Bitbucket: [Hiroki Omae](https://bitbucket.org/Hiroki Omae), ).


I would like to know more detail about the issue.
Do you want to make sure that those assets are excluded from final build, or do you want to make sure those assets are included?

from assetgraph.

hiroki-o avatar hiroki-o commented on June 16, 2024

Original comment by Matt D (Bitbucket: DWSMatt, GitHub: DWSMatt).


So they are excluded. Maybe make it as an option? It's just useful for people like me who are making the transition to bundles so they are visibly marked.

from assetgraph.

hiroki-o avatar hiroki-o commented on June 16, 2024

Original comment by Hiroki Omae (Bitbucket: [Hiroki Omae](https://bitbucket.org/Hiroki Omae), ).


Unfortunately setting assetBundleName does not exclude the asset from Player build. While assetBundleName does not provide the feature to exclude, my recommendation is to use Label to mark if the asset is already in asset bundle. With ABGT adding Postprocess script will allow you to do it. You can also set assetBundleName with Postprocess script in similar way if you really want to do that.

#!c#

using UnityEngine;
using UnityEditor;

using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

/**
Example code for asset bundle build postprocess.
*/
public class LabelAssetBundleAssets : AssetBundleGraph.IPostprocess {
	/* 
	 * DoPostprocess() is called when build performed.
	 * @param [in] reports	collection of AssetBundleBuildReport from each BundleBuilders.
	 */
	public void DoPostprocess (IEnumerable<AssetBundleGraph.AssetBundleBuildReport> buildReports, IEnumerable<AssetBundleGraph.ExportReport> exportReports) {

		string[] labels = {"InAssetBundle"};

		foreach (var report in buildReports) {
			foreach(var assets in report.AssetGroups.Values) {
				foreach(var a in assets) {
					AssetDatabase.SetLabels(a.data, labels);
					a.ReleaseData();
				}
			}
		}
	}
}

from assetgraph.

hiroki-o avatar hiroki-o commented on June 16, 2024

Original comment by Hiroki Omae (Bitbucket: [Hiroki Omae](https://bitbucket.org/Hiroki Omae), ).


I will put this to resolved temporarily - please reopen if proposed fix doesn't work.

from assetgraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.