Quantcast
Channel: Questions in topic: "selectiongrid"
Viewing all articles
Browse latest Browse all 94

How to insert an if statement for Selection Grid C#

$
0
0
Is there a way to insert an if statement for a Selection Grid? When I try to put in an if statement for this selection grid I get this error cannot implicitly convert type "int" to bool. using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { public int intTest; public int selectionGridInt = 0; public string[] selectionStrings = {"Grid 1", "Grid 2", "Grid 3", "Grid 4"}; void update(){ if(selectionGridInt = 1){//error cannot implicitly convert type "int" to bool ++intTest; } } void OnGUI () { selectionGridInt = GUI.SelectionGrid (new Rect (25, 25, 100, 60), selectionGridInt, selectionStrings, 1); } }

Viewing all articles
Browse latest Browse all 94

Trending Articles



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