Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

CS0019: Operator `&&' cannot be applied to operands of type `int' and `bool'

$
0
0
Error CS0019: Operator && cannot be applied to operands of type int and bool Code: ` using UnityEngine; using System.Collections; public class newChar : MonoBehaviour { private int playerGender = 0; private string[] genderStrings = {"Male", "Female"}; private int playerClass = 0; private string[] classStrings = {"Knight", "Assassin", "Ranger", "Wizard"}; public bool chosen = false; public GameObject maleKnight; public GameObject femaleKnight; public GameObject maleAssassin; public GameObject femaleAssassin; public GameObject maleRanger; public GameObject femaleRanger; public GameObject maleWizard; public GameObject femaleWizard; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnGUI(){ playerGender = GUI.Toolbar (new Rect (25, 25, 300, 50), playerGender, genderStrings); //Debug.Log(gender); playerClass = GUI.Toolbar (new Rect (25, 100, 300, 50), playerClass, classStrings); Debug.Log (playerClass); if(playerClass = 0 && playerGender.Equals(0)){ Instantiate(maleKnight, Vector3.zero, Quaternion.identity); } if(playerClass = 0 && playerGender.Equals(1)){ Instantiate(femaleKnight, Vector3.zero, Quaternion.identity); } if(playerClass = 1 && playerGender.Equals(0)){ Instantiate(maleAssassin, Vector3.zero, Quaternion.identity); } if(playerClass = 1 && playerGender.Equals(1)){ Instantiate(femaleAssassin, Vector3.zero, Quaternion.identity); } if(playerClass = 2 && playerGender.Equals(0)){ Instantiate(maleRanger, Vector3.zero, Quaternion.identity); } if(playerClass = 2 && playerGender.Equals(1)){ Instantiate(femaleRanger, Vector3.zero, Quaternion.identity); } if(playerClass = 3 && playerGender.Equals(0)){ Instantiate(maleWizard, Vector3.zero, Quaternion.identity); } if(playerClass = 3 && playerGender.Equals(1)){ Instantiate(femaleWizard, Vector3.zero, Quaternion.identity); } } } `

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>