• 大小: 26.82MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-22
  • 语言: 其他
  • 标签: Unity  

资源简介

Unity官方飞机大战练习 游戏的基本功能都能够实现 新手学习阶段 代码写的可能会比较Low 希望有下载学习的人能够和我分享意见和建议!

资源截图

代码片段和文件信息

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Asteroid : MonoBehaviourIGetScoreIExplosion
{
    private Rigidbody _rigidbody;
    public float _Speed;
    public float _AngularVelocity;
    public int _Score;
    public Gameobject _Explosion;

    void Start()
    {
        _rigidbody = GetComponent();
        _rigidbody.velocity = Vector3.back * _Speed;
        _rigidbody.angularVelocity = Random.insideUnitSphere * _AngularVelocity;
    }

    void Update()
    {

    }

    public void Explosion()
    {
        objectPool.GetGameobject(“AsteroidExlopsion“).transform.position = transform.position;
    }
    private void OnTriggerEnter(Collider collider)
    {
        if (collider.tag==“Player“)
        {
            collider.GetComponentyer>().Explosion();
            gameobject.SetActive(false);
            Destroy(collider.gameobject);
        }
    }

    public int GetScore()
    {
        return _Score;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-29 11:02  Project2_AirForce\
     目录           0  2018-12-27 19:06  Project2_AirForce\.vs\
     目录           0  2018-12-27 19:06  Project2_AirForce\.vs\Project2_AirForce\
     目录           0  2018-12-27 19:11  Project2_AirForce\.vs\Project2_AirForce\v15\
     文件      124416  2018-12-29 11:02  Project2_AirForce\.vs\Project2_AirForce\v15\.suo
     目录           0  2018-12-27 19:06  Project2_AirForce\.vs\Project2_AirForce\v15\Server\
     目录           0  2018-12-27 19:06  Project2_AirForce\.vs\Project2_AirForce\v15\Server\sqlite3\
     文件           0  2018-12-27 19:06  Project2_AirForce\.vs\Project2_AirForce\v15\Server\sqlite3\db.lock
     文件      757760  2018-12-29 10:19  Project2_AirForce\.vs\Project2_AirForce\v15\Server\sqlite3\storage.ide
     文件       32768  2018-12-29 09:35  Project2_AirForce\.vs\Project2_AirForce\v15\Server\sqlite3\storage.ide-shm
     文件     4136512  2018-12-29 11:02  Project2_AirForce\.vs\Project2_AirForce\v15\Server\sqlite3\storage.ide-wal
     文件       18688  2018-12-28 22:26  Project2_AirForce\Assembly-CSharp.csproj
     目录           0  2018-12-29 11:00  Project2_AirForce\Assets\
     文件        1041  2018-12-29 09:39  Project2_AirForce\Assets\Asteroid.cs
     文件         243  2018-12-27 20:51  Project2_AirForce\Assets\Asteroid.cs.meta
     目录           0  2018-12-27 18:38  Project2_AirForce\Assets\Audio\
     文件      149216  2018-05-02 23:07  Project2_AirForce\Assets\Audio\explosion_asteroid.wav
     文件         438  2018-05-02 23:07  Project2_AirForce\Assets\Audio\explosion_asteroid.wav.meta
     文件      174116  2018-05-02 23:07  Project2_AirForce\Assets\Audio\explosion_enemy.wav
     文件         438  2018-05-02 23:07  Project2_AirForce\Assets\Audio\explosion_enemy.wav.meta
     文件      326536  2018-05-02 23:07  Project2_AirForce\Assets\Audio\explosion_player.wav
     文件         438  2018-05-02 23:07  Project2_AirForce\Assets\Audio\explosion_player.wav.meta
     文件     2336432  2018-05-02 23:07  Project2_AirForce\Assets\Audio\music_background.wav
     文件         438  2018-05-02 23:07  Project2_AirForce\Assets\Audio\music_background.wav.meta
     文件       51004  2018-05-02 23:07  Project2_AirForce\Assets\Audio\weapon_enemy.wav
     文件         438  2018-05-02 23:07  Project2_AirForce\Assets\Audio\weapon_enemy.wav.meta
     文件       65792  2018-05-02 23:08  Project2_AirForce\Assets\Audio\weapon_player.wav
     文件         438  2018-05-02 23:08  Project2_AirForce\Assets\Audio\weapon_player.wav.meta
     文件         202  2018-05-02 23:07  Project2_AirForce\Assets\Audio.meta
     文件         316  2018-12-28 16:30  Project2_AirForce\Assets\Boundry.cs
     文件         243  2018-12-27 20:22  Project2_AirForce\Assets\Boundry.cs.meta
............此处省略1766个文件信息

评论

共有 条评论