• 大小: 17.43MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-27
  • 语言: 其他
  • 标签: unity3d  

资源简介

一个小游戏设计的完整工程,包含源码,图片资源和可执行文件。

资源截图

代码片段和文件信息

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

public class Bird : MonoBehaviour {

    // Movement speed
    public float speed = 2;

    public int success = -1;

    // Flap force
    public float force = 300;

    // Use this for initialization
    void Start()
    {
        success = -1;
        // Fly towards the right
        GetComponent().velocity = Vector2.right * speed;
    }

    // Update is called once per frame
    void Update()
    {
        // Flap 
        if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0))
            GetComponent().AddForce(Vector2.up * force);
    }

    void OnCollisionEnter2D(Collision2D collision)
    {
        success = 0;
        Destroy(this.gameobject);
    }

    void OnTriggerEnter2D(Collider2D collision)
    {
        success = 1;
        Destroy(this.gameobject);
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-11 16:07  BIRD\
     目录           0  2018-01-09 22:07  BIRD\.vs\
     目录           0  2018-01-09 22:07  BIRD\.vs\BIRD\
     目录           0  2018-01-09 22:07  BIRD\.vs\BIRD\v15\
     文件       61440  2018-01-09 21:58  BIRD\.vs\BIRD\v15\.suo
     目录           0  2018-01-09 22:07  BIRD\.vs\BIRD\v15\Server\
     目录           0  2018-01-09 22:07  BIRD\.vs\BIRD\v15\Server\sqlite3\
     文件           0  2018-01-06 14:25  BIRD\.vs\BIRD\v15\Server\sqlite3\db.lock
     文件      606208  2018-01-09 21:58  BIRD\.vs\BIRD\v15\Server\sqlite3\storage.ide
     文件        5829  2018-01-09 21:47  BIRD\Assembly-CSharp.csproj
     目录           0  2018-01-09 22:07  BIRD\Assets\
     文件       39799  2018-01-07 12:23  BIRD\Assets\Game.unity
     文件         175  2018-01-06 14:26  BIRD\Assets\Game.unity.meta
     目录           0  2018-01-09 22:07  BIRD\Assets\png\
     文件         192  2018-01-06 13:34  BIRD\Assets\png.meta
     目录           0  2018-01-09 22:07  BIRD\Assets\png\animation\
     文件         192  2018-01-06 14:16  BIRD\Assets\png\animation.meta
     文件        2589  2018-01-06 14:26  BIRD\Assets\png\animation\bird_0.controller
     文件         208  2018-01-06 14:19  BIRD\Assets\png\animation\bird_0.controller.meta
     文件        2224  2018-01-06 14:26  BIRD\Assets\png\animation\New Animation.anim
     文件         208  2018-01-06 14:19  BIRD\Assets\png\animation\New Animation.anim.meta
     文件        7157  2017-06-19 15:55  BIRD\Assets\png\background.png
     文件        1607  2018-01-06 13:34  BIRD\Assets\png\background.png.meta
     文件        7204  2017-06-19 15:55  BIRD\Assets\png\bird.png
     文件        3100  2018-01-06 14:02  BIRD\Assets\png\bird.png.meta
     文件        9494  2017-06-19 15:55  BIRD\Assets\png\ground.png
     文件        1607  2018-01-06 13:34  BIRD\Assets\png\ground.png.meta
     文件        3054  2017-06-19 15:55  BIRD\Assets\png\obstacle.png
     文件        1607  2018-01-06 13:34  BIRD\Assets\png\obstacle.png.meta
     文件      114941  2018-01-07 12:13  BIRD\Assets\png\success.png
     文件        1607  2018-01-07 12:15  BIRD\Assets\png\success.png.meta
............此处省略1167个文件信息

评论

共有 条评论