Advertisement

Unity技巧总结:图形界面绘制与加载掩膜技术

阅读量:

直接提供代码示例,并附带详细注释说明

复制代码
     public Texture _mask, _circle;//遮罩图片,旋转图片

    
  
    
     private bool _isLoading = false;//运行标志
    
     private float _uvCoord, _loadingTime = 5.0f;//旋转图片位置, Loading时间(过了自动停止)
    
  
    
     void LoadingAnimi()
    
     {
    
     if (_isLoading)
    
     {
    
         int screenW = Screen.width, screenH = Screen.height;
    
         GUI.DrawTexture(new Rect(0, 0, screenW, screenH), _mask);//遮罩
    
  
    
         //旋转圈
    
         _uvCoord += Time.deltaTime * 100;
    
         GUIUtility.RotateAroundPivot(_uvCoord, new Vector2(screenW / 2, scre

全部评论 (0)

还没有任何评论哟~