当前位置:网站首页>Can I "reverse" a Boolean value- Can I 'invert' a bool?
Can I "reverse" a Boolean value- Can I 'invert' a bool?
2022-07-04 15:52:00 【Bustling city 】
problem :
I have some checks to see if a screen is active. I have some checks to see if the screen is active .The code looks like this: The code is as follows :
if (GUI.Button(new Rect(Screen.width / 2 - 10, 50, 50, 30), "Rules")) //Creates a button { if (ruleScreenActive == true) //check if the screen is already active ruleScreenActive = false; //handle according to that else ruleScreenActive = true; }
Is there any way to - whenever I click the button - invert the value of ruleScreenActive
? What can be done - Whenever I click a button - reverse ruleScreenActive
Value ?
(This is C# in Unity3D)( This is a Unity3D Medium C#)
Solution :
Reference resources : https://stackoom.com/en/question/bOVd边栏推荐
- MySQL index optimization
- Redis sentinel mode realizes one master, two slave and three Sentinels
- Unity脚本常用API Day03
- Blood cases caused by Lombok use
- %F format character
- [book club issue 13] ffmpeg common methods for viewing media information and processing audio and video files
- Logstash~Logstash配置(logstash.yml)详解
- 输入宽度!
- Align left and right!
- go-zero微服务实战系列(九、极致优化秒杀性能)
猜你喜欢
随机推荐
JS tile data lookup leaf node
直播预告 | PostgreSQL 内核解读系列第二讲:PostgreSQL 体系结构
Unity脚本API—GameObject游戏对象、Object 对象
一篇文章学会GO语言中的变量
[flask] ORM one to many relationship
Force button brush question 01 (reverse linked list + sliding window +lru cache mechanism)
进制形式
Lombok使用引发的血案
AI做题水平已超过CS博士?
c# 实现定义一套中间SQL可以跨库执行的SQL语句
odoo数据库主控密码采用什么加密算法?
go-zero微服务实战系列(九、极致优化秒杀性能)
【读书会第十三期】视频文件的编码格式
PXE network
Unity脚本API—Transform 变换
web聊天室实现
What is the future of the booming intelligent Internet of things (aiot) in recent years?
2022年九大CIO趨勢和優先事項
Scientific research cartoon | what else to do after connecting with the subjects?
Huawei cloud database DDS products are deeply enabled