资源简介
(新手入门)使用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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 355328 2018-02-26 21:37 GameUpUp\.vs\GameUpUp\v15\.suo
文件 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
..A..H. 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
文件 16037 2018-02-26 10:56 GameUpUp\Assets\Audios\hold.mp3
..A..H. 500 2018-02-26 11:00 GameUpUp\Assets\Audios\hold.mp3.me
文件 18744 2018-02-26 10:58 GameUpUp\Assets\Audios\MarioHoldFlag.mp3
..A..H. 500 2018-02-26 11:00 GameUpUp\Assets\Audios\MarioHoldFlag.mp3.me
文件 35152 2018-02-26 10:43 GameUpUp\Assets\Audios\MarioJump.mp3
..A..H. 500 2018-02-26 11:00 GameUpUp\Assets\Audios\MarioJump.mp3.me
文件 24552 2018-02-26 20:44 GameUpUp\Assets\Audios\MarioJump1.mp3
..A..H. 500 2018-02-26 20:44 GameUpUp\Assets\Audios\MarioJump1.mp3.me
文件 24552 2018-02-26 20:44 GameUpUp\Assets\Audios\MarioJump2.mp3
..A..H. 500 2018-02-26 20:44 GameUpUp\Assets\Audios\MarioJump2.mp3.me
文件 14042 2018-02-26 10:49 GameUpUp\Assets\Audios\ob
..A..H. 500 2018-02-26 11:00 GameUpUp\Assets\Audios\ob
文件 39850 2018-02-26 10:50 GameUpUp\Assets\Audios\shua.mp3
..A..H. 500 2018-02-26 11:00 GameUpUp\Assets\Audios\shua.mp3.me
..A..H. 214 2018-02-26 11:00 GameUpUp\Assets\Audios.me
I.A.... 4160 2018-02-25 17:52 GameUpUp\Assets\Materials\ba
..A..H. 231 2018-02-25 16:23 GameUpUp\Assets\Materials\ba
文件 413712 2018-01-03 20:51 GameUpUp\Assets\Materials\Chessman\Chessman.fbx
..A..H. 2065 2018-01-03 20:56 GameUpUp\Assets\Materials\Chessman\Chessman.fbx.me
I.A.... 5028 2018-02-25 17:52 GameUpUp\Assets\Materials\Chessman\Materials\lambert1.mat
..A..H. 180 2018-01-03 20:56 GameUpUp\Assets\Materials\Chessman\Materials\lambert1.mat.me
..A..H. 192 2018-01-03 20:56 GameUpUp\Assets\Materials\Chessman\Materials.me
..A..H. 192 2018-01-03 20:56 GameUpUp\Assets\Materials\Chessman.me
文件 83131 2018-02-26 16:11 GameUpUp\Assets\Materials\Cursors\CursorClick.png
............此处省略2811个文件信息
- 上一篇:c#web开发入门经典
- 下一篇:C#-数据库操作技术-员工管理系统
评论
共有 条评论