background preloader


Facebook Twitter

Loading Asset Bundle from cache directory. Реализация системы динамически загружаемого контента (DLC) для мобильной игры в Unity 3D. Недавно, для одной игры на Unity 3D, которую мы разрабатывали, возникла необходимость добавить DLC систему.

Реализация системы динамически загружаемого контента (DLC) для мобильной игры в Unity 3D

Хотя это оказалось далеко не так просто, как казалось в начале, мы успешно справились с возникшими проблемами и игра ушла в gold. В этой статье я хочу изложить наш вариант реализации DLC, рассказать о возникших проблемах и как мы их решили. Постановка задачи В игре есть магазин, где игрок покупает вещи за игровую или реальную валюту. В магазине – более 200 вещей. Содержимое DLC и работа с ним в игре В игре вещи полностью определяются файлом itemdata.txt, в котором содержится информация о вещах и их текстурах. Public String GetItemDataBase() { if(DLCManager.isDLCLoaded() == true) { String itemListStr = DLCManager.GetTextFileFromAllDLCs(“itemdata”); return itemListStr; } else { TextAsset itemTextFile = Resources.Load(“itemdata”) as TextAsset; return itemTextFile.text; } return String.Empty; } Аналогично при запросе текстуры, мы проверяем её наличие в DLC. Файл DLC Резюме. Программирование, компьютерная графика, игры и развлечения.

// AssetBundle Exporter v.1.0 // Copyright (C) 2013 Sergey Taraban < // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. using UnityEngine; using UnityEditor;

Unity3D File Based Assetbundles on the iPhone « Chris Danielson's Blog. Let me start off by saying that Unity3D is a really great game engine.

Unity3D File Based Assetbundles on the iPhone « Chris Danielson's Blog

Let me also say that I wish the documentation was as great as the engine is. Sadly, it’s difficult to figure out some of the more powerful features of Unity3D without significant trial and error. Please note, that I have read that the usage of Assetbundles on the iPhone can be memory intensive and may or may not fit your needs per your project. I am just putting this information here so that others can see how to do this. Pro Tip: What this means to you? Assumptions: 1. OK, if you’re still feeling good, let’s bounce into this how-to. Create the Project Open up a new project in Unity3D and set it up for “iPhone” iOS. In the project hierarchy, let’s go ahead and create a simple directory structure as follows: AssetBundle Workflow – Unity Asia Bootcamp.

AssetBundles (Pro only) AssetBundles are files which you can export from Unity to contain assets of your choice.

AssetBundles (Pro only)

These files use a proprietary compressed format and can be loaded on demand by your application. This allows you to stream in content, such as models, textures, audio clips, or even entire scenes separately from the scene in which they will be used. AssetBundles have been designed to simplify downloading content to your application. AssetBundles can contain any kind of asset type recognized by Unity, as determined by the filename extension. If you want to include files with custom binary data, they should have the extension ".bytes". When working with AssetBundles, here's the typical workflow: During development, the developer prepares AssetBundles and uploads them to a server. Building and uploading asset bundles Building AssetBundles. At runtime, on the user's machine, the application will load AssetBundles on demand and operate individual assets within each AssetBundle as needed.

See also: Асинхронная инстанциация ассетов. В общем, всё отлично.

Асинхронная инстанциация ассетов

AssetBundle и их загрузка. Per Asset Versioning with Unity Asset Bundles – Juicebox Games. So one of the cooler frameworks offered by Unity is its asset bundle system.

Per Asset Versioning with Unity Asset Bundles – Juicebox Games

Asset bundles are really nothing more than bits of game content rolled together into an LZMA Compressed bundle that can be redistributed – either over the wire or off disk. Your bundles can contain both Unity primitives – textures and meshes – as well as arbitrarily complex GameObject hierarchies that can contain your custom scripts.

Probably the easiest way to conceptualize a bundle is a zipped prefab object and its the best way to stream content to your Unity game. An Asset Bundle is a platform ready asset – in that it’s contents have been compiled and optimized for its target platform. Because of this, you should generally prep a version of your bundle for each platform you intend to target. There’s a few reasons its generally a good idea to bundle some or most of your content: Using Bundles presents a few workflow challenges Step 1 – Content Iteration We’re a single scene, prefab-heavy game. Step 5 – S3 Sync. Building a Custom Resource Loading Solution.

There is going to be a point in the development of many projects for iOS and Android that you might decide your system for loading content at runtime needs a major upgrade.

Building a Custom Resource Loading Solution

Maybe you’re targeting a 50 MB size for your app so people can download it over a cellular connection.