J'ai un bug dans mon jeu, un jeu VR sur android, que je suis entrain de créer, j'ai créé un menu, qui apparait quand "Time.timeScale = 0", pour les objets ramassé, j'ai quatre catégorie d'objet (arme, vie, armure, construction).
dans mon inventaire, j'ai 4 panneaux qui apparaissent et qui permettent de choisir quel item on désire avoir en main.
lorsque j'active les 3 premiers pas de problème des le 4eme ça bug le jeu se met en pause, rien, n'apparait le head tracker s'arrête, et ne repart que lors que je quitte le menu. J'ai donc 4 scripts qui pour géréer les items, voici le dernier qui fait que le menu freeze quand je le lance :
Code : Tout sélectionner
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ChoixConstruct : MonoBehaviour {
public GameObject Blank;
public GameObject Construc1;
public GameObject Construc2;
public GameObject Construc3;
public Text TauxConstruc;
public int cell;
//liés à la progressbar
public float progress = 0.0f;
public Texture2D emptyProgressBar; // Set this in inspector.
public Texture2D fullProgressBar; // Set this in inspector.
public Vector2 pos = new Vector2(20, 40);
public Vector2 size = new Vector2(60, 20);
public bool StartBar = false;
public float TempsDepart = 0f;
public Scrollbar ProgressBarre;
private bool PeutChanger;
void Awake()
{
PeutChanger = true;
if (PlayerPrefs.GetInt("C" + cell + "Number") == 0) PlayerPrefs.SetInt("C" + cell + "Type", 0);
if (PlayerPrefs.GetInt("C" + cell + "Type") == 0)
{
Blank.SetActive(true);
Construc1.SetActive(false);
Construc2.SetActive(false);
Construc3.SetActive(false);
}
if (PlayerPrefs.GetInt("C" + cell + "Type") == 1)
{
Blank.SetActive(false);
Construc1.SetActive(true);
Construc2.SetActive(false);
Construc3.SetActive(false);
}
if (PlayerPrefs.GetInt("C" + cell + "Type") == 2)
{
Blank.SetActive(false);
Construc1.SetActive(false);
Construc2.SetActive(true);
Construc3.SetActive(false);
}
if (PlayerPrefs.GetInt("C" + cell + "Type") == 3)
{
Blank.SetActive(false);
Construc1.SetActive(false);
Construc2.SetActive(false);
Construc3.SetActive(true);
}
}
void Start()
{
}
void Update()
{
TauxConstruc.text = "";
if (PlayerPrefs.GetInt("C" + cell + "Type") != 0) TauxConstruc.text = PlayerPrefs.GetInt("C" + cell + "Number") + "/5";
//Liés à la progressbar
if (StartBar == true && !Blank.activeSelf)
{
progress = (Time.unscaledTime - TempsDepart) * 0.5f;
}
if (progress > 1.00f && PeutChanger)
{
ChangeWeapon();
PeutChanger = false;
}
ProgressBarre.size = progress;
}
//Liés à la prosgreesbar
public void BarreStart()
{
TempsDepart = Time.unscaledTime;
StartBar = true;
}
public void BarreStop()
{
progress = 0f;
StartBar = false;
PeutChanger = true;
}
//Choix de la Langue
//Choix de la Langue
public void ChangeWeapon()
{
}
}