• 大小: 29.38MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-11
  • 语言: 其他
  • 标签: unity3D  发射炮弹  

资源简介

实现效果: 点击 “w” 键,坦克前进,点击 “s” 键,坦克后退,点击 “a” 键,坦克向左转,点击 “d” 键,坦克向右转。 点击 “空格” 键,坦克发射炮弹(这里的炮弹是一棵树),当炮弹碰到物体时,物体和炮弹都消失。 当坦克走近关卡时,关卡自动打开,当坦克远离关卡时,关卡自动闭合。

资源截图

代码片段和文件信息

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()
    {
        
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           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.meta
     文件         540  2019-10-19 10:28  work4\Assets\Door.cs
     文件         243  2019-10-19 10:12  work4\Assets\Door.cs.meta
     目录           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.meta
     文件         172  2019-10-19 08:10  work4\Assets\Scenes.meta
     目录           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.meta
     目录           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.meta
     文件      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.meta
     文件      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.meta
     文件      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.meta
     文件      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.meta
     文件      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.meta
     文件      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.meta
     文件      102285  2019-10-19 08:13  work4\Assets\SimpleMilitary\Demo\DemoAssets\Demo_Characters_RPG.controller
............此处省略4671个文件信息

评论

共有 条评论