資源簡(jiǎn)介
實(shí)現(xiàn)效果:
點(diǎn)擊 “w” 鍵,坦克前進(jìn),點(diǎn)擊 “s” 鍵,坦克后退,點(diǎn)擊 “a” 鍵,坦克向左轉(zhuǎn),點(diǎn)擊 “d” 鍵,坦克向右轉(zhuǎn)。
點(diǎn)擊 “空格” 鍵,坦克發(fā)射炮彈(這里的炮彈是一棵樹),當(dāng)炮彈碰到物體時(shí),物體和炮彈都消失。
當(dāng)坦克走近關(guān)卡時(shí),關(guān)卡自動(dòng)打開,當(dāng)坦克遠(yuǎn)離關(guān)卡時(shí),關(guān)卡自動(dòng)閉合。
代碼片段和文件信息
using?System.Collections;
using?System.Collections.Generic;
using?UnityEngine;
public?class?Bullet?:?MonoBehaviour
{
????//public?Transform?effect;
????//?Start?is?called?before?the?first?frame?update
????void?Start()
????{
????????
????}
????void?OnCollisionEnter(Collision?other)
????{
????????//Transform?ef?=?Instantiate(effect?other.collider.transform.position?Quaternion.identity);
????????//Destroy(ef?3);
????????Debug.Log(“hhh“);
????????Destroy(other.gameobject);
????????Destroy(this.gameobject);
????}
????//?Update?is?called?once?per?frame
????void?Update()
????{
????????
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-10-19?18:48??work4\
?????文件???????42358??2019-10-19?10:12??work4\Assembly-CSharp.csproj
?????目錄???????????0??2019-10-19?10:59??work4\Assets\
?????文件?????????633??2019-10-19?10:59??work4\Assets\Bullet.cs
?????文件?????????243??2019-10-19?10:03??work4\Assets\Bullet.cs.me
?????文件?????????540??2019-10-19?10:28??work4\Assets\Door.cs
?????文件?????????243??2019-10-19?10:12??work4\Assets\Door.cs.me
?????目錄???????????0??2019-10-19?11:31??work4\Assets\Scenes\
?????文件???????23706??2019-10-19?11:31??work4\Assets\Scenes\SampleScene.unity
?????文件?????????155??2019-10-19?08:10??work4\Assets\Scenes\SampleScene.unity.me
?????文件?????????172??2019-10-19?08:10??work4\Assets\Scenes.me
?????目錄???????????0??2019-10-19?08:12??work4\Assets\SimpleMilitary\
?????文件?????????629??2015-07-17?04:52??work4\Assets\SimpleMilitary\Changelog.txt
?????文件??????????93??2015-07-17?04:52??work4\Assets\SimpleMilitary\Changelog.txt.me
?????目錄???????????0??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\
?????目錄???????????0??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\
?????文件??????105349??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_AssultRifleAuto.controller
?????文件??????????95??2015-07-17?04:51??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_AssultRifleAuto.controller.me
?????文件??????105279??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_AssultRifleSingle.controller
?????文件??????????95??2015-07-17?04:52??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_AssultRifleSingle.controller.me
?????文件??????105270??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_DeadBack.controller
?????文件??????????95??2015-07-17?04:53??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_DeadBack.controller.me
?????文件??????105271??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_DeadFront.controller
?????文件??????????95??2015-07-17?04:53??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_DeadFront.controller.me
?????文件??????104089??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_Grenade.controller
?????文件??????????95??2015-07-17?04:51??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_Grenade.controller.me
?????文件??????105275??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_Hands?on?hips.controller
?????文件??????????95??2015-07-17?04:52??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_Hands?on?hips.controller.me
?????文件??????102295??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_Pistol_Shooting.controller
?????文件??????????95??2015-07-17?04:51??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_Pistol_Shooting.controller.me
?????文件??????102285??2019-10-19?08:13??work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_RPG.controller
............此處省略4671個(gè)文件信息
評(píng)論
共有 條評(píng)論