<div id="article_content" class="article_content clearfix"> <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css"> <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-044f2cf1dc.css"> <div id="content_views" class="markdown_views prism-tomorrow-night"> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path> </svg> <p></p> <div class="toc"> <h4><a name="t0"></a><a href="https://so.csdn.net/so/search?q=Unity&spm=1001.2101.3001.7020" target="" class="hl hl-1" data-report-click="{"spm":"1001.2101.3001.7020","dest":"https://so.csdn.net/so/search?q=Unity&spm=1001.2101.3001.7020","extra":"{\"searchword\":\"Unity\"}"}" data-tit="Unity" data-pretit="unity">Unity</a>学习笔记(零基础到就业)|Chapter01:C#入门</h4> <ul><li><a href="#_7" rel="nofollow" target="_self">前言</a></li><li><a href="#_14" rel="nofollow" target="_self">一、控制台输入输出语句</a></li><li><a href="#_20" rel="nofollow" target="_self">二、初识变量</a></li><li><ul><li><a href="#1tips_21" rel="nofollow" target="_self">1.一些好用的tips</a></li><li><a href="#2_57" rel="nofollow" target="_self">2.变量声明的固定写法</a></li><li><a href="#3_69" rel="nofollow" target="_self">3.变量类型</a></li></ul> </li><li><a href="#_71" rel="nofollow" target="_self">三、变量的本质</a></li><li><ul><li><a href="#1_72" rel="nofollow" target="_self">1.变量的存储空间</a></li><li><a href="#22_78" rel="nofollow" target="_self">2.变量的本质:2进制</a></li></ul> </li><li><a href="#_88" rel="nofollow" target="_self">四、变量的命名规范</a></li><li><ul><li><a href="#1_89" rel="nofollow" target="_self">1.必须遵守的规则</a></li><li><a href="#2_91" rel="nofollow" target="_self">2.常用命名规范</a></li></ul> </li><li><a href="#_99" rel="nofollow" target="_self">五、常量</a></li><li><ul><li><a href="#1_100" rel="nofollow" target="_self">1.常量的声明</a></li><li><a href="#2_103" rel="nofollow" target="_self">2.常量的特点</a></li></ul> </li><li><a href="#_105" rel="nofollow" target="_self">六、转义字符</a></li><li><ul><li><a href="#1_106" rel="nofollow" target="_self">1.转义字符的使用</a></li><li><a href="#2_109" rel="nofollow" target="_self">2.取消转义字符</a></li></ul> </li><li><a href="#_112" rel="nofollow" target="_self">七、类型转换(不同变量类型之间的相互转换)</a></li><li><ul><li><a href="#1_113" rel="nofollow" target="_self">1.隐式转换</a></li><li><ul><li><a href="#1_115" rel="nofollow" target="_self">(1)相同大类型之间的转换规则</a></li><li><a href="#2_126" rel="nofollow" target="_self">(2)不同大类型之间的转换规则</a></li></ul> </li><li><a href="#2_134" rel="nofollow" target="_self">2.显式转换</a></li><li><ul><li><a href="#1_136" rel="nofollow" target="_self">(1)括号强转</a></li><li><a href="#2Parse_139" rel="nofollow" target="_self">(2)Parse法</a></li><li><a href="#3Convert_148" rel="nofollow" target="_self">(3)Convert法</a></li><li><a href="#4stringToString_161" rel="nofollow" target="_self">(4)其他类型转string(ToString)</a></li></ul> </li></ul> </li><li><a href="#_176" rel="nofollow" target="_self">八、异常捕获</a></li><li><a href="#_195" rel="nofollow" target="_self">九、运算符</a></li><li><ul><li><a href="#1_196" rel="nofollow" target="_self">1.算数运算符</a></li><li><a href="#2_207" rel="nofollow" target="_self">2.字符串拼接</a></li><li><a href="#3_235" rel="nofollow" target="_self">3.条件运算符</a></li><li><a href="#4_245" rel="nofollow" target="_self">4.逻辑运算符</a></li><li><a href="#5_251" rel="nofollow" target="_self">5.位运算符</a></li><li><a href="#6_279" rel="nofollow" target="_self">6.三目运算符</a></li></ul> </li><li><a href="#_294" rel="nofollow" target="_self">十、条件分支语句</a></li><li><ul><li><a href="#1if_295" rel="nofollow" target="_self">1.if</a></li><li><ul><li><a href="#1if_301" rel="nofollow" target="_self">(1)if语句</a></li><li><a href="#2if_else_311" rel="nofollow" target="_self">(2)if else语句</a></li><li><a href="#3if_else_if_else_323" rel="nofollow" target="_self">(3)if else if else语句</a></li></ul> </li><li><a href="#2Switch_338" rel="nofollow" target="_self">2.Switch</a></li></ul> </li><li><a href="#_379" rel="nofollow" target="_self">十一、循环语句</a></li><li><ul><li><a href="#1while_380" rel="nofollow" target="_self">1.while</a></li><li><a href="#2do_while_405" rel="nofollow" target="_self">2.do while</a></li><li><a href="#3for_416" rel="nofollow" target="_self">3.for</a></li><li><a href="#4foreach_447" rel="nofollow" target="_self">4.foreach</a></li></ul> </li><li><a href="#_460" rel="nofollow" target="_self">总结</a></li></ul> </div> <p></p> <hr> <h2><a name="t1"></a><a id="_7"></a>前言</h2> <p>游戏作为一种情感表达的载体,在让玩家感到有趣和感动的同时,也建立了人与人之间的链接,我想看看更多在不同意识形态和文化背景下的知识的碰撞和思想的迸发,所以开始了<a href="https://so.csdn.net/so/search?q=%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91&spm=1001.2101.3001.7020" target="_blank" class="hl hl-1" data-report-view="{"spm":"1001.2101.3001.7020","dest":"https://so.csdn.net/so/search?q=%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91&spm=1001.2101.3001.7020","extra":"{\"searchword\":\"游戏开发\"}"}" data-report-click="{"spm":"1001.2101.3001.7020","dest":"https://so.csdn.net/so/search?q=%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91&spm=1001.2101.3001.7020","extra":"{\"searchword\":\"游戏开发\"}"}" data-tit="游戏开发" data-pretit="游戏开发">游戏开发</a>的自学之路,人生就这一次,就这么几十年,喜欢什么想要尝试什么咱就去做吧~</p> <p><code>这系列的学习笔记主要是根据唐老狮的unity实战路线课程整理的,加入了自己的一些补充和理解,该课程涉及的知识内容非常多,我并未学完,而是根据就业需求挑选学习的,也对后续框架部分进行了一些修改,希望能通过整理并时常阅读这些笔记巩固开发知识,也希望能跟在学习unity的小伙伴一起分享、探讨,笔记中有疑问或出错的部分也希望大佬们能够给予指导鸭~
标签:语句,入门,C#,笔记,运算符,int,类型,string,变量 From: https://www.cnblogs.com/yutian-blogs/p/18358134