stream level
stream level
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 .
Re: stream level
En C# (pour résumer) ton fichier doit avoir le même nom que la classe définis, soit GameLoading.csnamursite a écrit :can' t add scrip behaviour ; the scripts file name does not match the name of class defined in the script
Sinon, par pitié, crénondédiousse, utilises les balises
Code : Tout sélectionner
[/code.] [img]http://r26.imgfast.net/users/2612/65/52/49/smiles/54660.gif[/img]
[size=65](edit message cela serait bien, sous peine de voir ton sujet vérouillé)[/size]
Pas d'aide par MP, le forum est là pour ça.
En cas de doute sur les bonnes pratiques à adopter sur le forum, consulter la Charte et sa FAQ
Re: stream level
// j aime bien le crénondédiousse, oui pardon les balises
merci une fois de plus pfff une bêtise , merci .
mais maintenant il ne va pas chercher le fichier sur le serveur mais lui même en boucle
vous avez compris que je ne suis pas programmeur ,
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameLoading : MonoBehaviour {
int progress;
void Start()
{
string url = "http://namursite.be/1objets/GameLoading.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("scene1");
}
}
heuuu , vous n 'avez sous la main un pack :-) qui fonctionne :-)[
encore merci d'avance pour votre gentillesse
merci une fois de plus pfff une bêtise , merci .
mais maintenant il ne va pas chercher le fichier sur le serveur mais lui même en boucle
vous avez compris que je ne suis pas programmeur ,
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameLoading : MonoBehaviour {
int progress;
void Start()
{
string url = "http://namursite.be/1objets/GameLoading.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("scene1");
}
}
heuuu , vous n 'avez sous la main un pack :-) qui fonctionne :-)[
encore merci d'avance pour votre gentillesse
Re: stream level
+100yoyoyaya a écrit :J'ai l'impression de lire pauslsta là.
Re: stream level
Code : Tout sélectionner
Bon honnètement les balises , je ne le fais pas exprès , vous parlez des smileys ,
cette étape est la plus importante car je pourrai démarrer mon projet , j ai la plus part des scripts qui fonctionnent .
donc merci de votre compréhension , + 100 une petite précision
Re: stream level
Édite tes posts pour rajouter les balises codes, si tu sais pas comment faire, demande.
C'est pas compliqué, on comprend rien à un code sans ça.
C'est pas compliqué, on comprend rien à un code sans ça.
Re: stream level
Code : Tout sélectionner
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameLoading : MonoBehaviour {
int progress;
void Start()
{
string url = "http://namursite.be/1objets/GameLoading.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("scene1");
}
}
Re: stream level
bon je suppose que bon maintenant pour les balises ( voir posts précédents )
merci d avance
merci d avance