Merhaba, Unity C# eğitimine bugün başladım fakat aldığım bir sıkıntı var. _scripts adında boş obje oluşturdum "Kodlama" isimli bir C# dosyası oluşturup onun içerisine attım. Kodları yazıp programı çalıştırmama rağmen çıktı alamıyorum. Editör olarak da visual studio 2019 seçili aşağıya kodları ve görselleri ekledim. Lütfen yardımcı olun.
Kodlar:
<code>// kodlari calismasi icin gerekli komutlar</code> <code>using System.Collections;</code> <code>using System.Collections.Generic;</code> <code>using UnityEngine;</code>
<code>public class Kodlama : MonoBehaviour</code> <code>{</code> <code> int sayiDegerleri = 5;</code> <code> bool oyunBasladi = false;</code> <code> void Start() // program calistiginda sadece 1 kere calistirilir</code> <code> {</code> <code> if (sayiDegerleri == 5) // sayi degeri 5 ise</code> <code> Debug.Log("Değeriniz 5"); // 5 ise cikti</code> <code> else if (sayiDegerleri == 4) // eger yukaridaki degil buysa</code> <code> Debug.Log("Değeriniz 4"); // 4 ise cikti</code> <code> else // eger ikisi de degilse</code> <code> Debug.Log("Değeriniz 4 veya 5 Değil"); // cikti</code> <code> }</code>
<code> void Update() // 30 framelik bir programda saniyede 30 kere calistirilir</code> <code> {</code> <code> </code> <code> }</code> <code>}</code>
Kodlar:
<code>// kodlari calismasi icin gerekli komutlar</code>
<code>using System.Collections;</code>
<code>using System.Collections.Generic;</code>
<code>using UnityEngine;</code>
<code>public class Kodlama : MonoBehaviour</code>
<code>{</code>
<code> int sayiDegerleri = 5;</code>
<code> bool oyunBasladi = false;</code>
<code> void Start() // program calistiginda sadece 1 kere calistirilir</code>
<code> {</code>
<code> if (sayiDegerleri == 5) // sayi degeri 5 ise</code>
<code> Debug.Log("Değeriniz 5"); // 5 ise cikti</code>
<code> else if (sayiDegerleri == 4) // eger yukaridaki degil buysa</code>
<code> Debug.Log("Değeriniz 4"); // 4 ise cikti</code>
<code> else // eger ikisi de degilse</code>
<code> Debug.Log("Değeriniz 4 veya 5 Değil"); // cikti</code>
<code> }</code>
<code> void Update() // 30 framelik bir programda saniyede 30 kere calistirilir</code>
<code> {</code>
<code> </code>
<code> }</code>
<code>}</code>
Görsel 1:
< Resime gitmek için tıklayın >
Görsel 2:
< Resime gitmek için tıklayın >