全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
static function DrawPreviewTexture (position : Rect, image : Texture, mat : Material = null, scaleMode : ScaleMode = ScaleMode.StretchToFill, imageAspect : float = 0) : void Parameters参数 positionRectangle on the screen to draw the texture within.屏幕上绘制纹理的矩形区域 imageTexture to display. / 显示的纹理 scaleModeHow to scale the image when the aspect ratio of it doesnt fit the aspect ratio to be drawn within.当纹理的尺寸不适合这个区域时如何缩放 matMaterial to be used when drawing the texture. 当绘制纹理时使用的材质 imageAspectAspect ratio to use for the source image. If 0 (the default), the aspect ratio from the image is used. 用于源图片的纵横比。如果为0(默认),使用源图片的纵横比 Description描述Draws the texture within a rectangle.在矩形内绘制纹理。If mat is null (the default), an appropriate material will be chosen for a RGBM or doubleLDR lightmap or a normal map and the fallback blit material will be chosen otherwise. 如果mat为空(默认),一个适当的材料将被选择为RGBM或doubleLDRlightmap或者一个正常的贴图和背景材料,否则将使用被选择的材质Preview Texture in an Editor Window. 编辑器中的预览纹理。/ Load a texture, display the texture, display its alpha channel and/ show a preview of the inverted texture/加载并这个纹理,显示其Alpha通道,并显示该纹理的反向预览【狗刨学习网】class EditorGUITextures extends EditorWindow var texture : Texture2D;var invertedTexture : Texture2D;var showInverted = false;MenuItem(Examples/Texture Previewer)static function Init() var window = GetWindow(EditorGUITextures);window.position = Rect(0,0,400, 200);window.Show();function OnGUI() texture = EditorGUI.ObjectField(Rect(3,3,200,20),Add a Texture:,texture,Texture);if(GUI.Button(Rect(208,3, position.width - 210, 20),Process Inverted) if(invertedTexture)DestroyImmediate(invertedTexture);/Copy the new texture/复制新的纹理invertedTexture = new Texture2D(texture.width,texture.height,texture.format,(texture.mipmapCount != 0);for (var m : int = 0; m texture.mipmapCount; m+)invertedTexture.SetPixels(texture.GetPixels(m), m);InvertColors();showInverted = true;if(texture) EditorGUI.PrefixLabel(Rect(25,45,100,15),0,GUIContent(Preview:);EditorGUI.DrawPreviewTexture(Rect(25,60,100,100),texture);EditorGUI.PrefixLabel(Rect(150,45,100,15),0,GUIContent(Alpha:);EditorGUI.DrawTextureAlpha(Rect(150,60,100,100),texture);EditorGUI.PrefixLabel(Rect(275,45,100,15),0,GUIContent(Inverted:);if(showInverted)EditorGUI.DrawPreviewTexture(Rect(275,60,100,100),invertedTexture);if(GUI.Button(Rect(3,position.height - 25, position.width-6,20),Clear texture) texture = EditorGUIUtility.whiteTexture;showInverted = false; else EditorGUI.PrefixLabel(Rect(3,position.height - 25,position.width - 6, 20),0,GUIContent(No texture found);function InvertColors() for (var m : int = 0; m invertedTexture.mipmapCount; m+) var c : Color = invertedTexture.GetPixels(m);for (var i : int = 0 ;i c.Length; i+) c
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 5G全息投影在高等教育中的应用分析
- 500kV变压器保护过激磁告警不能自动复归原因分析
- 350例矮身材女童染色体核型分析
- 220kV母差及失灵保护技改过程中若干问题的分析
- 2021年福建省中考英语主旨类和推理类阅读题考查特点研究及教学建议
- 2019年北京高考物理24题引发的思考
- 1982-2014年汀江流域长汀段水沙演变规律分析
- 110kV输电线路电磁辐射环境影响分析
- 10kV线路缺相运行影响问题探讨
- 抗肿瘤药物治疗的护理形象
- 2024年汕头市普通高考第二次模拟考试(二模)英语试卷(含答案)
- 《文创产品包装设计》课件-2.1 任务一:文创产品包装设计发展的品牌化
- 2023-2024学年北师大版八年级下册数学期中测试题
- 养老院健康档案模板
- 2024年4月山东潍坊市人才引进面试题及参考答案
- 《航运市场营销》课件-马士基航运集团
- (2024年)建筑行业财务培训资料
- 中医术语英译
- 8.3文化视角下的翻译之“用”.ppt
- 第七版《方剂学》课本方歌.doc
- 办公文秘英语
评论
0/150
提交评论