stream level
Publié : 22 Avr 2013 18:15
hello une semaine
que je cherche , je voudrais faire du stream avec http://pastebin.com/pWLFMW46 depuis un serveur .
j en ai trouver un qui pas d 'erreur .
----
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameLoading : MonoBehaviour {
int progress;
void Start()
{
string url = "http://monsite.be/1objets/scene 1.unity3d";
StartCoroutine(StartDownloadScene(url));
}
void Update()
{
}
void OnGUI()
{
Vector2 pos = new Vector2(20, 40);
Vector2 size = new Vector2(360, 10);
GUIStyle customStyle = new GUIStyle();
Texture2D tex = new Texture2D(10, 10);
tex.SetPixel(10, 10, Color.gray);
customStyle.normal.background = tex;
if (progress != 100)
{
GUILayout.Label(progress + "%");
GUI.BeginGroup(new Rect(pos.x, pos.y, progress, size.y));
// Define progress bar texture within customStyle under Normal > Background
GUI.Box(new Rect(0, 0, size.x, size.y), "", customStyle);
// Always match BeginGroup calls with an EndGroup call
GUI.EndGroup();
}
}
IEnumerator StartDownloadScene(string url)
{
WWW download = new WWW(url);
while (!download.isDone)
{
//Ici on gère la barre de progression
progress = System.Convert.ToInt32(download.progress * 100);
//On attend sagement la fin du téléchargement
yield return null;
}
//On charge la scène ainsi téléchargée.
Application.LoadLevelAdditive("scene 1");
}
}
mais j ai dans uniity , le message suivant
can' t add scrip behaviour ; the scripts file name does not match the name of class defined in the script
comment faut il l ' appliquer .
je obstiné mais je commence haaaaaa , merci pour votre aide .
que je cherche , je voudrais faire du stream avec http://pastebin.com/pWLFMW46 depuis un serveur .
j en ai trouver un qui pas d 'erreur .
----
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameLoading : MonoBehaviour {
int progress;
void Start()
{
string url = "http://monsite.be/1objets/scene 1.unity3d";
StartCoroutine(StartDownloadScene(url));
}
void Update()
{
}
void OnGUI()
{
Vector2 pos = new Vector2(20, 40);
Vector2 size = new Vector2(360, 10);
GUIStyle customStyle = new GUIStyle();
Texture2D tex = new Texture2D(10, 10);
tex.SetPixel(10, 10, Color.gray);
customStyle.normal.background = tex;
if (progress != 100)
{
GUILayout.Label(progress + "%");
GUI.BeginGroup(new Rect(pos.x, pos.y, progress, size.y));
// Define progress bar texture within customStyle under Normal > Background
GUI.Box(new Rect(0, 0, size.x, size.y), "", customStyle);
// Always match BeginGroup calls with an EndGroup call
GUI.EndGroup();
}
}
IEnumerator StartDownloadScene(string url)
{
WWW download = new WWW(url);
while (!download.isDone)
{
//Ici on gère la barre de progression
progress = System.Convert.ToInt32(download.progress * 100);
//On attend sagement la fin du téléchargement
yield return null;
}
//On charge la scène ainsi téléchargée.
Application.LoadLevelAdditive("scene 1");
}
}
mais j ai dans uniity , le message suivant
can' t add scrip behaviour ; the scripts file name does not match the name of class defined in the script
comment faut il l ' appliquer .
je obstiné mais je commence haaaaaa , merci pour votre aide .