Unity鼠标接触自动旋转点击出现菜单
var enable:boolean;
var i = 1;
var id ="";
var info="";
var url="http://www.baidu.com";
//var url="http://localhost/data/getinfo.asp";
var tiptext:GUIText;
var textskin : GUISkin;
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url+id);
// Wait for download to complete
yield www;
// assign texture
info=www.text;
}
function OnGUI(){
GUI.skin = textskin ;
if (i % 2 ==0){
GUI.Button(Rect (500,10,300,300),info);
}
}
function OnMouseDown(){
//if (Input.GetMouseButton(0)){
i ++;
//}
}
function OnMouseOver () {
transform.Rotate(0, Time.deltaTime*100, 0, Space.World);
//tiptext.transform.position=new Vector3(Input.mousePosition.x/Screen.width,Input.mousePosition.y/Screen.height,0);
//tiptext.text=id;
}
function OnMouseEnter(){
renderer.material.color = Color.blue;
//tiptext.text ="1111";
//tiptext.transform.position=new Vector3(Input.mousePosition.x/Screen.width,Input.mousePosition.x/Screen.height,0);
//tiptext.transform.position=camera.ScreenToWorldPoint(Vector3(Input.mousePosition.x,Input.mousePosition.y,0));
}
function OnMouseExit(){
renderer.material.color = Color.yellow;
}
laikankanaaaaaaaaaa
想实现一个小功能,有一个cube,通过鼠标滑动的方向来实现这个cube平滑的旋转一定的角度,也就是可以全方位的看到这个Cube各个位置?请指点! 感谢提共 啊 先下来看看谢谢分享 好帖就是要顶 顶顶多好 真心顶 说的非常好 LZ真是人才
页:
[1]