fratalkanan
Centipat
- Katılım
- 9 Eylül 2023
- Mesajlar
- 9
Daha fazla
- Cinsiyet
- Erkek
Arkadaşlar ben oyun yapıyodum sorulanlar diye bi kısım var oyunu başlatınca geliyor oyunu bitirince.
NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.get_intValue () (at <97436df440ca462884c5332c1d8ebbe7>:0)
diyerek kayboluyor kodlar burada yardım.
NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.get_intValue () (at <97436df440ca462884c5332c1d8ebbe7>:0)
diyerek kayboluyor kodlar burada yardım.
C#:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Yarışma : MonoBehaviour
{
public Text soruadi,cevapa,cevapb,cevapc;
Sorular sr;
public List<bool> sorulanlar;
public int cevap;
void Start()
{
sr = GetComponent<Sorular>
();
for(int i =0;i < sr.sorular.Count;i++){
sorulanlar.Add(false);
}
SoruEkle ();
}
void Update()
{
}
public void SoruEkle(){
int sorusayi = Random.Range(0,sorulanlar.Count);
if(sorulanlar[sorusayi] == false) {
sorulanlar[sorusayi] = true;
soruadi.text = sr.sorular [sorusayi].soruadi;
cevapa.text = sr.sorular[sorusayi].cevapa;
cevapb.text = sr.sorular[sorusayi].cevapb;
cevapc.text = sr.sorular[sorusayi].cevapc;
cevap = sr.sorular[sorusayi].cevap;
}else{
SoruEkle ();
}
}
public void CevapVer(int deger){
if(deger == cevap){
SoruEkle();
}else {
Debug.Log ("YANLIŞ");
}
}
}
Son düzenleyen: Moderatör: