public void DoSomething(DecisionSystem.Choice choice) { switch (choice) { case DecisionSystem.Choice.ChoosePathUp: HandleChoice0(); break; case DecisionSystem.Choice.ChoosePathMiddle: HandleChoice1(); break; case DecisionSystem.Choice.ChoosePathBottom: HandleChoice2(); break; case DecisionSystem.Choice.AceptarNPC: HandleChoice3(); break; case DecisionSystem.Choice.NegarNPC: HandleChoice4(); break; case DecisionSystem.Choice.Pensar: HandleChoice5(); break; default: Debug.LogError("no handler for this " + choice + " SHIT"); break; } }
private void HandlePlayerVote(string[] msg) { if (NotInClientScene()) { int playerId = Int32.Parse(msg[1]); DecisionSystem.Choice choice = (DecisionSystem.Choice)Enum.Parse(typeof(DecisionSystem.Choice), msg[2]); LevelManager levelManager = GameObject.FindObjectOfType <LevelManager>(); string decisionName = levelManager.localPlayer.decisionName; if (decisionName != null) { DecisionSystem currentDecision = GameObject.Find(decisionName).GetComponent <DecisionSystem>(); currentDecision.ReceiveVote(playerId, choice); } } }