资源简介
有助于你对opengl的一些函数加深认识,值得学习,就是一个实例。
代码片段和文件信息
/* CopyRight by Onedimension
2016/6/20
*/
using UnityEngine;
using System.Collections;
public class BallCheck : MonoBehaviour {
Gameobject[] numberBalls;
Gameobject whiteBall;
public Gameobject tableStickController;
StickController stickController;
// Use this for initialization
void Start () {
numberBalls = Gameobject.FindGameobjectsWithTag(“NumberBall“);
if (numberBalls.Length != 15)
Debug.Log (“Less than 15 Balls?“);
whiteBall = Gameobject.FindGameobjectWithTag (“WhiteBall“);
stickController = tableStickController.GetComponent ();
}
// Update is called once per frame
void Update () {
if (SceneManager.isBallMoving == true) {
if (CheckOneBallMotionless(whiteBall) &&CheckAllNumberBalls ()) {
SceneManager.isBallMoving = false;
stickController.ResetTableStickAndRelated ();
}
}
}
bool CheckAllNumberBalls() {
for (int i = 0; i < numberBalls.Length; i++) {
if(!CheckOneBallMotionless (numberBalls[i])) {
return false;
}
}
return true;
}
bool CheckOneBallMotionless(Gameobject oneBall) //物体消失或速度过小都算停止
{
if (oneBall.activeSelf == true) {
Rigidbody oneRigidbody = oneBall.GetComponent ();
if (oneRigidbody.velocity.magnitude < 0.0001 && oneRigidbody.angularVelocity.magnitude < 0.0001)
return true;
else
return false;
} else
return true;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4604 2016-06-20 12:16 PoolBilliardTable1.2\Assembly-CSharp.csproj
I.A.... 171196 2016-06-20 14:17 PoolBilliardTable1.2\Assets\begin.unity
..A..H. 175 2016-05-25 16:59 PoolBilliardTable1.2\Assets\begin.unity.me
文件 4908 2016-06-07 21:11 PoolBilliardTable1.2\Assets\Materials\Red.mat
..A..H. 180 2016-06-07 15:36 PoolBilliardTable1.2\Assets\Materials\Red.mat.me
文件 4916 2016-06-05 21:14 PoolBilliardTable1.2\Assets\Materials\Transparent.mat
..A..H. 180 2016-06-03 11:24 PoolBilliardTable1.2\Assets\Materials\Transparent.mat.me
文件 1924 2016-06-05 02:08 PoolBilliardTable1.2\Assets\Materials\Transparent.png
..A..H. 1208 2016-06-05 02:09 PoolBilliardTable1.2\Assets\Materials\Transparent.png.me
..A..H. 192 2016-05-25 11:48 PoolBilliardTable1.2\Assets\Materials.me
文件 44110944 2016-05-27 08:27 PoolBilliardTable1.2\Assets\Models\BilliardTable.FBX
..A..H. 11341 2016-05-27 08:28 PoolBilliardTable1.2\Assets\Models\BilliardTable.FBX.me
文件 4888 2016-05-27 08:28 PoolBilliardTable1.2\Assets\Models\Materials\2.mat
..A..H. 180 2016-05-27 08:28 PoolBilliardTable1.2\Assets\Models\Materials\2.mat.me
文件 30073 2012-10-27 22:29 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525120.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525120.jpg.me
文件 29627 2012-10-27 22:29 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525165.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525165.jpg.me
文件 24979 2012-10-27 22:29 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525502.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525502.jpg.me
文件 28838 2012-10-27 22:29 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525511.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525511.jpg.me
文件 140354 2014-01-07 18:32 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525524.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525524.jpg.me
文件 98673 2014-01-07 18:32 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525537.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525537.jpg.me
文件 25210 2012-10-27 22:29 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525549.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525549.jpg.me
文件 24597 2012-10-27 22:29 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525565.jpg
..A..H. 1208 2016-05-27 08:30 PoolBilliardTable1.2\Assets\Models\Materials\20130926103339525565.jpg.me
............此处省略992个文件信息
- 上一篇:基于ssh病人系统完整版
- 下一篇:mod_wsgi-windows
评论
共有 条评论