资源简介
(新手入门)使用U3D开发的跳一跳小游戏,入门级,没有复杂的代码,只是简单的功能实现,代码使用C#,unity版本2017 适合初学者提升对U3D游戏开发的兴趣 主要实现的功能: 1.按下鼠标跳棋会压缩,松开鼠标跳棋跳出,跳出距离与按下鼠标时间成正比,通过刚体实现 2.随机生成圆柱形和方形的底座,底座大小随机,底座生成方向随机 3.跳棋蓄力带粒子特效(官方自带),跳出带有拖尾特效,特效资源来自网络 4.一些简单的音效 5.一些简单的UI,包括分数统计等等
代码片段和文件信息
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
// This is the PocketRPG weapon trail. For best results itterate it and your animation several times a frame.
// It is based on the Tron trails Unity example
// PocketRPG trails run faster than the framerate... (default is 300 frames a second)... that is how they are so smooth (30fps trails are rather jerky)
// This code was written by Evan Greenwood (of Free Lives) and used in the game PocketRPG by Tasty Poison Games.
// But you can use this how you please... Make great games... that‘s what this is about.
// This code is provided as is. Please discuss this on the Unity Forums if you need help.
//
class TronTrailSection
{
public Vector3 point;
public Vector3 upDir;
public float time;
public TronTrailSection() {
}
public TronTrailSection(Vector3 p float t) {
point = p;
time = t;
}
}
[RequireComponent(typeof(MeshFilter))]
[AddComponentMenu(“PocketRPG/Weapon Trail“)]
public class WeaponTrail : MonoBehaviour {
/*
Generates a trail that is always facing upwards using the scriptable mesh interface. (This is from the Tron Trails in Unity)
vertex colors and uv‘s are generated similar to the builtin Trail Renderer. But it DOES NOT RUN ITSELF LIKE THE TRAIL RENDERER. (there is no update method)
To use it
1. Create an empty game object (your weapon) with it‘s y axis pointing along the weapons blade.
2. Attach this script and a MeshRenderer
3. Then assign a particle material to the mesh renderer
4. Call it‘s Itterate method everytime you sample the animation (if you want a smooth trail this should be more than once a frame)
5. Call it‘s UpdateTrail method once a frame to rebuild the mesh
*/
#region Public
public float height = 2.0f;
public float time = 2.0f;
public bool alwaysUp = false;
public float minDistance = 0.1f;
public float timeTransitionSpeed = 1f;
public float desiredTime = 2.0f;
public Color startColor = Color.white;
public Color endColor = new Color(1 1 1 0);
#endregion
//
#region Temporary
Vector3 position;
float now = 0;
TronTrailSection currentSection;
Matrix4x4 localSpaceTransform;
#endregion
#region Internal
private Mesh mesh;
private Vector3[] vertices;
private Color[] colors;
private Vector2[] uv;
#endregion
#region Customisers
private MeshRenderer meshRenderer;
private Material trailMaterial;
#endregion
private List sections = new List();
void Awake() {
MeshFilter meshF = GetComponent(typeof(MeshFilter)) as MeshFilter;
mesh = meshF.mesh;
meshRenderer = GetComponent(typeof(MeshRenderer)) as MeshRenderer;
trailMaterial = meshRenderer.material;
}
public void StartTrail(float timeToTweenTo float fadeInTim
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-12-22 17:35 微信跳一跳\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\GameUpUp\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\GameUpUp\v15\
文件 355328 2018-02-26 21:37 微信跳一跳\GameUpUp\.vs\GameUpUp\v15\.suo
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\GameUpUp\v15\Server\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\GameUpUp\v15\Server\sqlite3\
文件 0 2018-02-25 13:16 微信跳一跳\GameUpUp\.vs\GameUpUp\v15\Server\sqlite3\db.lock
文件 1142784 2018-02-26 21:37 微信跳一跳\GameUpUp\.vs\GameUpUp\v15\Server\sqlite3\storage.ide
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\GameUpUp-csharp\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\.vs\GameUpUp-csharp\v14\
文件 35840 2018-01-03 22:03 微信跳一跳\GameUpUp\.vs\GameUpUp-csharp\v14\.suo
文件 4127 2018-01-03 21:48 微信跳一跳\GameUpUp\Assembly-CSharp-vs.csproj
文件 4127 2018-01-03 21:48 微信跳一跳\GameUpUp\Assembly-CSharp.csproj
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\Assets\
目录 0 2018-12-22 17:35 微信跳一跳\GameUpUp\Assets\Audios\
文件 18744 2018-02-26 10:58 微信跳一跳\GameUpUp\Assets\Audios\MarioHoldFlag.mp3
文件 500 2018-02-26 11:00 微信跳一跳\GameUpUp\Assets\Audios\MarioHoldFlag.mp3.me
文件 35152 2018-02-26 10:43 微信跳一跳\GameUpUp\Assets\Audios\MarioJump.mp3
文件 500 2018-02-26 11:00 微信跳一跳\GameUpUp\Assets\Audios\MarioJump.mp3.me
文件 24552 2018-02-26 20:44 微信跳一跳\GameUpUp\Assets\Audios\MarioJump1.mp3
文件 500 2018-02-26 20:44 微信跳一跳\GameUpUp\Assets\Audios\MarioJump1.mp3.me
文件 24552 2018-02-26 20:44 微信跳一跳\GameUpUp\Assets\Audios\MarioJump2.mp3
文件 500 2018-02-26 20:44 微信跳一跳\GameUpUp\Assets\Audios\MarioJump2.mp3.me
文件 14042 2018-02-26 10:49 微信跳一跳\GameUpUp\Assets\Audios\ob
文件 500 2018-02-26 11:00 微信跳一跳\GameUpUp\Assets\Audios\ob
文件 16037 2018-02-26 10:56 微信跳一跳\GameUpUp\Assets\Audios\hold.mp3
文件 500 2018-02-26 11:00 微信跳一跳\GameUpUp\Assets\Audios\hold.mp3.me
文件 39850 2018-02-26 10:50 微信跳一跳\GameUpUp\Assets\Audios\shua.mp3
文件 500 2018-02-26 11:00 微信跳一跳\GameUpUp\Assets\Audios\shua.mp3.me
............此处省略2808个文件信息
相关资源
- C#编写的Gerber查看器
- 明华URF-35H读卡器 C#读写源码 为大家
- U3D 简化版跳一跳小游戏新手入门 源码
- Basler相机通过IO触发源码
- vb调用c#编写的串口DLL文件(vb源码
- C#读大智慧dat数据源码
- C#进行单击操作、单击位置记录、捕获
- BouncyCastle C#源码
- asp.net 访问odbc informix源码及配置截图
- Unity5实战:使用C#和Unity开发多平台游
- C#完整工作流系统源码
- C#做的一个图片浏览器源码
- ASP.NET众筹网源码
- 最新9个C# .NET Winform的多线程进度条源
- ASP.NET MVC5+EasyUI企业开发框架源码
- C#三层酒店管理系统(完整源码,可根
- c#服装店销售管理源码系统无限制全功
- 精通ASP.NET MVC 5 随书源码
- 基于ASP.NET网上服装销售系统源码
- OA系统+手机版源码t源代码
- Unity5.0切水果游戏C#
- 查找硬盘里的文件中的关键词含源码
- c# 生成 bt种子 文件 bt 源码
- ASP.NET网上购物商城系统(源码)
- c# 棋牌游戏源码c# 棋牌游戏源码
- C#语音朗读DLL测试源码[成熟代码可直
- 网上选课系统 网页版 C# 开发 asp.net
- UPS断电后服务器自动关机工具+源码
- Unity2D小游戏——炸弹人类似qq堂的小
- C# C/s项目源码
评论
共有 条评论