- 最后登录
- 2016-10-1
- 注册时间
- 2013-12-28
- 阅读权限
- 90
- 积分
- 5805
- 纳金币
- 2954
- 精华
- 3
|
- using UnityEngine;
- using System.Collections;
-
- public class ro : MonoBehaviour {
- public Texture2D image;//图片
- public float rotspeed = 100;//速度
- private float rotangle;//角度
- void Update()
- {
- rotangle += Time.deltaTime * rotspeed;//角度
- }
- void OnGUI()
- {
- Matrix4x4 _matrix = GUI.matrix;//[size=1]变换矩阵[/size]
- GUIUtility.RotateAroundPivot(rotangle, new Vector2(Screen.width/2,Screen.height/2));// 1变量 角度 2变量 旋绕点
- GUI.DrawTexture(new Rect(Screen.width/2-image.width/2,Screen.height/2-image.height/2,image.width,image.height),image);//绘画图
- GUI.matrix = _matrix;//变换矩阵
- GUI.Label(new Rect(10, 10, 100, 20), "转啊转啊转......");//label
-
- }
- }
复制代码 |
|