A. 濡备綍鍦╱nity3d
濡傛灉浣犱互铡熷嬫牸寮忥纸渚嫔.max銆.blend銆.mb銆.ma锛変粠澶ч儴鍒3D杞浠跺寘淇濆瓨3D鏂囦欢鍒颁綘镄勯”鐩瓵ssets鏂囦欢澶逛腑锛屽畠浠灏呜瀵煎叆鍒版墦寮镄3D鍖匜BX瀵煎嚭鎻掍欢涓銆傛垨钥呬綘浠FBX镙煎纺浠庝綘镄3D搴旂敤绋嫔簭瀵煎嚭3D鏂囦欢鍒皍nity椤圭洰涓銆
棣栧厛锛屾垜浠闇瑕佸湪3dmax閲岃剧疆鍗曚綅銆傜劧钖庡皢鏄剧ず鍗曚綅鍜岀郴缁熷崟浣嶆瘆渚嬮兘璁剧疆鎴愬帢绫筹纴铹跺悗纭瀹氥
棣栧厛镓揿紑unity鐣岄溃锛屽湪Asset鐩褰曚笅鍒涘缓鏂囦欢澶笷BX锛屽皢闇瑕佸煎叆镄刦bx棰勫埗浣撴垨鏁翠釜鏂囦欢澶规嫋鍏ュ垱寤虹殑FBX鏂囦欢澶逛笅锛岀劧钖庨変腑闇瑕佺殑fbx棰勫埗浣揿苟𨰾栬呖鍦烘櫙涓锛屽弻鍑诲畾浣嶅埌褰揿墠鐗╀綋銆
functionOnGUI(){if(GUI.Button(Rect(Screen.width/2锛孲creen.height-30锛50锛30)锛宎Texture)){Application.LoadLevel(0)锛泒锝濆湪杩欎釜鑴氭湰璧嬩篑鍓崭竴涓狲cene镄刢amera锛孉pplication.LoadLevel(0)锛涜緭鍏ヤ笅涓涓狲cene镄刲evel灏卞彲浠ヤ简銆
璁╁埆浜虹粰浣犲啓浠g爜镊宸辨病杩涙ョ殑銆傛垜镐濊矾锻婅瘔浣狅细鎸夐挳镄勭偣鍑绘湁涓涓猽nity閲岄溃宸茬粡链夌殑鏂规硶锛歄nClick()浜嬩欢銆备綘涔熷彲浠ヨ嚜宸卞啓鏂规硶銆
voidOnMouseDown(){Destroy(obj.gameObject)锛泒鍙浠ュ皾璇旷湅鐪嬭繖涓榧犳爣镣瑰嚮浜嬩欢锛屾斁鍦ㄨ剼链涓巙pdate钖岀骇灏卞彲浠ヤ简銆傛柊镓嬶纴濡傛灉瑙佽В涓嶅綋锛岃锋寚姝o纴澶氲阿浜嗐
1銆佸浘褰㈠紩镎庯细浣跨敤镄勬槸Direct3D銆丱penGL鍜岃嚜链夌殑APIs銆傝祫婧愬煎叆锛氶”鐩璧勬簮浼氲镊锷ㄥ煎叆锛屽苟镙规嵁璧勬簮镄勬敼锷ㄨ屾洿鏂般俇nity鏀鎸佺殑涓绘祦涓夌淮寤烘ā链3dsmax銆丮aya銆丅lender绛夈傜潃镩插櫒(shaders)锛氱紪鍐欎娇鐢⊿haderLab銆
2銆佷娇鐢ㄦ湰韬玌GUI锛孶GUI鏄疷nity瀹樻柟鎺ㄥ嚭镄勬渶鏂癠I绯荤粺锛孶I灏辨槸UserInterface銆傛妸鎽勫儚链虹殑鎶曞奖鏀逛负姝d氦鎶曞奖锛屼笉钥冭槛Z杞.浣跨敤Untiy镊韬镄2D妯″纺锛屽湪2d妯″纺涓锛屽眰绾ц嗗浘涓鍙链変竴涓姝d氦鎽勫儚链猴纴鍦烘櫙瑙嗗浘阃夋嫨镄勬槸2D妯″纺銆
3銆佸埌链钖庡埌瀛︿範Unity3d镄勫湴褰㈢紪杈戙佹惮镀忔満鎺у埗銆乁nity3d鐗╃悊鎺у埗銆佷娇鐢–#缂栫▼璇瑷瀵筓nity3d缂栫▼銆乁nity3d绮掑瓙寮鍙戠郴缁熴乁nity3d瀵昏矾绯荤粺銆佷娇鐢∟GUI鍒朵綔鐣岄溃銆佽法骞冲彴鍙戝竷浣滃搧銆
1銆佷富瑕佽茶堪浣跨敤javascript鑴氭湰浣挎父鎴忕粍浠跺疄琛屾寜WSAD阌绉诲姩锛屽︿範瀹屾よ剼链钖庡彲浠ュ皢鑴氭湰闄勫姞鍦ㄧ墿浣扑笂锛屼娇鐗╀綋鑳藉疄鐜扮Щ锷ㄣ
2銆佸畾涔夐渶瑕佺Щ锷ㄧ殑鐗╀綋鍒楄〃銆傚彲浠ヤ娇鐢ㄦ暟缁勬垨鍒楄〃𨱒ュ瓨鍌ㄩ渶瑕佺Щ锷ㄧ殑鐗╀綋銆傜紪鍐欑Щ锷ㄤ唬镰併傚彲浠ヤ娇鐢╢or寰鐜阆嶅巻闇瑕佺Щ锷ㄧ殑鐗╀綋锛屽规疮涓鐗╀綋杩涜岀Щ锷ㄦ搷浣溿傚皢浠g爜娣诲姞鍒伴傚綋镄勪綅缃銆
3銆佺版挒鍙戠敓钖庝娇鐢≧andom.Range(0锛1)鐢熶骇闅忔満鏁0鎴栬1锛岀劧钖0宸﹁浆銆1鍙宠浆鍗冲彲銆傝寸槠浜嗗氨鏄鐢ㄩ殢链烘暟涔堛
4銆佹惮镀忔満涔熸槸涓涓猤ameObject瀵逛簬绉诲姩鎽勫儚链虹殑鏂规硶鍏跺疄涓庣Щ锷╣ameObject镄勬柟娉曟槸涓镙风殑銆傝繖鏄鎴戠殑涓涓鏂规硶锛屾斁鍒癠pdate鏂规硶閲岄溃鍗冲彲銆傚啓寰楀彲鑳戒笉澶濂斤纴璇疯佽皡銆傚姛鑳芥槸榧犳爣绉诲姩鍒板睆骞曡竟妗嗙Щ锷ㄦ惮镀忔満銆
鍦╱islider閲岄溃鎸备釜鍏辨湁鍙橀噺publicUILablelabel鍦ㄥ兼敼鍙樼殑鍑芥暟閲岄溃銆俵abel.text=val銆
鏂板缓宸ョ▼锛屽垱寤篊#鑴氭湰锛屽悕绉拌嚜𨰾熴傚弻鍑昏剼链镓揿紑MonoDeveloper锛屽啓涓嫔傚浘镓绀轰唬镰侊细鍒囨崲锲炲満鏅锛屽皢鑴氭湰缁戝畾鍒版ā鍨嬩笂銆傜偣鍑昏繍琛屾寜阍璋冭瘯锛岄粯璁ょ墿浣挞殣钘忋傜偣鍑绘寜阍锛岀墿浣撴樉绀猴纴浣嗕笉褰卞搷鎸夐挳镄勯殣钘忓拰鏄剧ず銆
Unity3D鐩鍓嶆敮鎸佷笁绉嶈瑷镄勮剼链绋嫔簭锛屽寘𨰾珻#銆丣avaScript銆丅oo锛屽湪涓涓娓告垙涓寮鍙戣呭彲浠ヤ娇鐢ㄤ竴绉嶆垨钥呭悓镞朵娇鐢ㄥ氱嶈瑷𨱒ュ疄鐜拌剼链镄勬带鍒躲
Game绐楀彛鍙充笂鏂圭殑Status锛岄噷闱㈡湁涓涓猅ris锛屽彲浠ユ煡鐪嬫暣涓鍦烘櫙镄勯溃鏁般
1銆佺涓夋ワ纴瀛︿範鍒涘缓锘烘湰鍦烘櫙镄勪竴浜涘熀链姒傚康锛氭父鎴忓硅薄銆佺粍浠躲佽剼链銆傚湪鐣岄溃涓婂垎鍒浣撶幇鍦ㄥ眰娆¤嗗浘锛岄”鐩瑙嗗浘鍙婂睘镐ц嗗浘锛岃佺悊娓呭郊姝や箣闂寸殑鍏崇郴锛屽彲浠ュ埌缃戜笂鐪嬩竴浜沀nity3D鏁欑▼銆
2銆佺涓阒舵靛簲璇ュ厛铡诲︿範涓浜涘熀纭c#璇瑷锛屼箣钖庤窡镌瑙嗛戝幓锅氩嚑涓绠鍗旷殑妗堜緥锛岀啛鎭変竴涓嫔紩镎庣殑锘烘湰镎崭綔鑻辫濂界殑鍙浠ュ幓鐪嫔畼鏂圭殑妗堜緥锛岃嫳璇涓鑸镄勫悓瀛﹁繖閲屾帹钻愬幓鐪媠iki钥佸笀镄勬暀绋嬨
3銆佺敤unity3D镊甯︾殑瑙掕壊锛屽湪project宸ヤ綔鍖哄唴镄勫彸杈逛腑鍗曞嚮鍙抽敭銆傚湪寮瑰嚭镄勯夐”妗嗕腑镓惧埌ImportPackage钬斺擟haracters锛屽嵆瀵煎叆浜虹墿瑙掕壊鍖呫傜偣鍑筹mport寮濮嫔煎叆銆傚皢浜虹墿鏀剧疆钖堥傜殑浣岖疆锛屾帴涓嬫潵瑕佸仛镄勬槸涓轰汉鐗╂坊锷犲姩鐢汇
4銆侀渶瑕佷竴瀹氱殑鑻辫锘虹鍜宑#锘虹锛屾渶濂借缮浼氢竴浜沠w锛宫aya镄勬妧链銆
5銆佽屼粬浠镄勬搷浣滈兘鏄灏佽呭ソ镄勫彲瑙嗗寲镄勶纴鐩磋伞傞氲繃杩欎簺3d寤烘ā杞浠惰兘寰埚揩铡荤悊瑙h繖浜涜佺偣镄勬剰镐濄