Switch case is not working. Help!!!!,Switch Case is not working.
I was test the Switch case after a youtube tutorial video and, no matters what I do, it just doesn´t do anyting. No text pops up in the Console. Here is my code: using System; using System.Collections; using System.Collections.Generic; using UnityEngine;
public class switch_case : MonoBehaviour { // Start is called before the first frame update void Start() { int test = 1; switch (test) { case 1: Debug.Log("one"); break; case 2: Debug.Log("two"); break; default: Debug.Log("whatever"); break; } }
// Update is called once per frame
void Update()
{
}
},I was testing the switch case after a youtube tutorial and, for no reason, this simply doesn´t work. I already tried everything and this comand does just nothing when I click on the play button at my Unity project. No text in the console.
Here is my code: using System; using System.Collections; using System.Collections.Generic; using UnityEngine;
public class switch_case : MonoBehaviour { // Start is called before the first frame update void Start() { int test = 1; switch (test) { case 1: Debug.Log("one"); break; case 2: Debug.Log("two"); break; default: Debug.Log("whatever"); break; } }
// Update is called once per frame
void Update()
{
}
}
Your answer
Follow this Question
Related Questions
Simple Question 2 Answers
Load Scene Unity by Application.LoadLevelAsync 0 Answers
Problem about finding script name 1 Answer
Calling a function from another script 0 Answers
List.FindIndex 1 Answer