Uuuuuunity

时间:2021-03-15 07:44:47

foreach http://blog.csdn.net/byondocean/article/details/6871881

yield  http://www.cnblogs.com/CareySon/archive/2009/12/16/1625469.html

unity切换摄像机(两个摄像机都要绑定)

using UnityEngine;
using System.Collections; public class test2 : MonoBehaviour {
public GameObject Maincamel; //// 通过在可视化界面中拖拽赋值
public GameObject Nextcamel;
// Use this for initialization
void Start () { } // Update is called once per frame
void Update () {
if (Input.GetKeyUp(KeyCode.Alpha1))
{
AllCamelFalse();
Maincamel.SetActive(true); /// // SetActive 属性置为false之后对象绑定的脚本也讲不执行
}
if (Input.GetKeyUp(KeyCode.Alpha2))
{
AllCamelFalse();
Nextcamel.SetActive(true);
} }
void AllCamelFalse()
{
Maincamel.SetActive(false);
Nextcamel.SetActive(false);
}
}

防止长武器与墙壁 重叠   http://www.mycmessia.com/2016/06/27/%E7%AC%AC%E4%B8%80%E4%BA%BA%E7%A7%B0%E5%B0%84%E5%87%BB%E6%B8%B8%E6%88%8F%E5%A6%82%E4%BD%95%E9%98%B2%E6%AD%A2%E8%B7%9D%E7%A6%BB%E8%BF%87%E8%BF%91%E6%97%B6%E6%AD%A6%E5%99%A8%E5%92%8C%E5%A2%99%E9%87%8D/

关于unity摄像机的一些使用  http://www.cfanz.cn/index.php?c=article&a=read&id=72433

使用UGUI做列表 http://www.cnblogs.com/neverdie/p/unity_ui_framework.html

http://blog.csdn.net/byondocean/article/details/6871881

iTween  http://www.xuanyusong.com/archives/2052   需要下载该插件先

http://www.cnblogs.com/clar/p/5692062.html  unity常用事件

GetCompent     http://blog.csdn.net/kaixindragon/article/details/44776451

http://www.ceeger.com/Script/GameObject/GameObject.GetComponent.html

Instantiate实例化出的对象是Object类型,需要强制转换一下,as强制把前面的东西转换成后面的

U3D】Unity3D的脚本-script入门   http://blog.163.com/shininglore@126/blog/static/961841802013412101454833/

 //获取目标位置
mTarget = transform.position;
//获取屏幕坐标
mScreen = Camera.main.WorldToScreenPoint(mTarget);
//将屏幕坐标转化为GUI坐标
mPoint = new Vector2(mScreen.x, Screen.height - mScreen.y);
 //炫酷的字体
GUIStyle frontStyle = new GUIStyle();
List<Transform> Body = new List<Transform>();//Transform的表
//保证目标在摄像机前方
if (mScreen.z > )
{
//GUI.color = Color.blue;
//内部使用GUI坐标进行绘制
frontStyle.fontSize = ;
frontStyle.normal.background = null;//设置背景填充
frontStyle.normal.textColor = new Color(, , );//设置字体颜色
GUI.Label(new Rect(, , ContentWidth, ContentHeight), "分数为" + Value.ToString(), frontStyle);
// mPoint.x,mPoint.y
}

相关文章