- Home /
Question by
ganesh.pingale · Nov 14, 2013 at 11:00 AM ·
assetsdownloaddynamic
Downloading assets from internet.
In may game user can change cloths of character but I want to updates the new clothes via internet.
Comment
Answer by tanoshimi · Nov 14, 2013 at 12:11 PM
You haven't asked a question, but the answer is probably the WWW class:
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour {
public string url = "http://yourserver.com/yournewclothes.jpg";
IEnumerator Start() {
WWW www = new WWW(url);
yield return www;
renderer.material.mainTexture = www.texture;
}
}
Thanks for the answer!! is it easy by this way or Assetbundle?
How do you define "easy"? The above does what you asked in under 10 lines of code... if you want to have downloadable clothes "packs", for example, that update your game then asset bundles are probably what you're looking for.