版本 |
作者 |
参与者 |
完成日期 |
备注 |
UnityAPI_Rect_V01_1.0 |
严立钻 |
|
2020.07.01 |
|
|
|
|
|
|
立钻哥哥:Unity是一个入门快、提高难的游戏引擎,想要提升能力,至少需要越过3道坎:API+Shader+综合能力;++1、API的积累:对API的合理利用不仅可以减轻自己的编码负担,而且往往可以提高程序的运行效率;这也是钻哥开始“Unity API”独立打造分类的初衷; ++2、Shader编程:想要做出一款精品游戏往往需要有高效的Shader的支持;Unity提供了一套改良的“Shader Lab”系统,优化了繁杂的“Open GL”编程; ++3、综合能力(技术+业务+管理):一款产品的制作除了功能编程外,往往会涉及很多其他领域,例如产品架构、UI交互设计、模型制作等,作为主要的编程人员,对其他相关领域的了解程序往往会影响到产品制作直至最后的产品体验; ++++立钻哥哥一直在推动【VR云游戏=Unity+SteamVR+云技术+5G+AI】,这个只是一个引子,抛砖引玉让大家对整个知识体系有一个明确的落地方向,宝宝们可以根据自己的兴趣方向进行拓展:比如Unity这里是指一种“3D游戏引擎”,也可拓展至“UE4、Cocos2dx”等游戏引擎;SteamVR是一种跨硬件解决方案,也可拓展至“VRTK”等第三方插件;“云技术+5G”是一种跨平台解决方案的核心技术,同样可拓展至其他平台解决方案;AI也是一种先进技术的举例,也可以拓展至任何一种前沿技术; |
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html
++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html
++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html
++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html
++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/
#Rect矩阵 |
#Rect矩阵++A1、Description描述++B2、Variables变量++C3、Public Function共有函数++D4、Message消息 |
#A1、Description描述 |
++++Unity使用2D空间坐标,大多数定义X向右增加,并且y定义向上增加;唯一例外是GUI和GUILayout类,Y向下增加;
++++可以指定矩阵的两种不同的方式:第一种是x,y,宽和高;另一种方法是用X和Y坐标的边缘,这些被称为xMin, xMax, yMin, yMax;
++++注意:尽管x和y与xMin, yMin的值相同,表现出不同的设置;设置x或y改变矩形的位置,但保留其大小;
++++设置xMin, xMax, yMin和yMax将会改变矩形的大小,但保留位置相反的边缘;
#B2、Variables变量 |
++B2、Variables变量++++B2.1、center++++B2.2、height++++B2.3、max++++B2.4、min++++B2.5、position++++B2.6、size++++B2.7、width++++B2.8、x++++B2.9、xMax++++B2.10、xMin++++B2.11、y++++B2.12、yMax++++B2.13、yMin++++B2.14、YanlzXREngine.Rect.Variables |
++B2.1、center |
public Vector2 center; |
++++矩形的中心点;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{ public Rect rect = new Rect(0, 0, 100, 100);
void MyTestFunc(){ Debug.Log(rect.center); rect.center = new Vector2(10, 10); } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzRect{} |
++B2.2、height |
public float height; |
++++矩形高度,从Y轴开始测量;
++++设置该值也会改变yMax;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{ public Rect rect = new Rect(0, 0, 10, 10);
void MyTestFunc(){ Debug.Log(rect.height); rect.height = 20; } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzRect{} |
++B2.3、max |
public Vector2 max; |
++++最大角的位置的矩形;
++++设置该值调整矩形的大小,改变最大值,最小值不变;
++B2.4、min |
public Vector2 min; |
++++最小角的位置的矩形;
++++设置该值调整矩形,改变位置和大小保留最大值;
++B2.5、position |
public Vector2 position; |
++++矩形的X和Y轴位置;
++++这和min一样,除了设置它会移动矩形而不是调整矩形大小;
++B2.6、size |
public Vector2 size; |
++++矩形的宽和高;
++++从position测量矩形的大小;
++B2.7、width |
public float width; |
++++矩形的宽度,从x位置开始测量;
++++设置该值将会改变xMax;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{
//Use the for initialization void Start(){ Rect rect = new Rect(10, 10, 50, 30); Debug.Log(“立钻哥哥:Width=” + rect.width); //prints: width=50
rect.width = 20; Debug.Log(“立钻哥哥:new max x=” + rect.xMax); //prints: new max x=30 } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzRect{} |
++B2.8、x |
public float x; |
++++矩形的左坐标;
++++该值与xMin的值一样,但设置会移动矩形而不是调整矩形的大小;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{
//Use the for initialization void Start(){ Rect rect = new Rect(10, 10, 50, 30); Debug.Log(“立钻哥哥:x =” + rect.x); //prints: x=10
rect.x = 20; Debug.Log(rect); //prints: (x:20, y:10, width:50, height:30s) } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzRect{} |
++B2.9、xMax |
public float xMax; |
++++矩形的右坐标;
++++改变这个值,矩形的左坐标将保留(因此矩形的宽高将会改变);
++B2.10、xMin |
public float xMin; |
++++矩形的左坐标;
++++该值与X一样,但设置它会调整矩形的大小,会改变X和宽,但保留右坐标xMax;
++B2.11、y |
public float y; |
++++矩形的顶坐标;
++++该值与yMin一样,但会移动该矩形而不是调整它的大小;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{
//Use the for initialization void Start(){ Rect rect = new Rect(10, 10, 50, 30); Debug.Log(“立钻哥哥:y =” + rect.y); //prints: y=10
rect.y = 20; Debug.Log(rect); //prints: (x:10, y:20, width:50, height:30s) } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzRect{} |
++B2.12、yMax |
public float yMax; |
++++矩形的底坐标;
++++设置该值将会改变高度保留yMin;
++B2.13、yMin |
public float yMin; |
++++矩形的顶坐标;
++++该值与y一样,但设置该值调整矩形的大小,改变y和高度保留底坐标;
#C3、Constructors构造 |
++C3、Constructors构造++++C3.1、Rect++++C3.2、YanlzXREngine.Rect.Constructors |
++C3.1、Rect |
public Rect(float x, float y, float width, float height);public Rect(Vector2 position, Vector2 size); |
++++[x]:矩形的x轴坐标;
++++[y]:矩形的y轴坐标;
++++[width]:矩形的宽;
++++[height]:矩形的高;
++++[position]:The position of the minimum corner of the rect;
++++[size]:The width and height of the rect;
++++创建新的矩形;
++++创建给定大小和位置的矩形;
++++注意:矩形代表一个抽象的矩形,可用于各种情况;因此,矩形没有一个明确的顶部、底部、左侧或右侧;在摄像机空间测量y值从屏幕的底部开始,但是在GUI编辑器空间从窗口的顶部开始测量,因此当使用矩形的y值时,y值明确是否是它的“顶部”或者“底部”;
Rect rect = new Rect(0, 0, 10, 10); |
#D4、Public Functions公共函数 |
++D4、Public Functions公共函数++++D4.1、Contains++++D4.2、Overlaps++++D4.3、Set++++D4.4、ToString++++D4.5、YanlzXREngine.Rect.PublicFunctions |
++D4.1、Contains |
public bool Contains(Vector2 point);public bool Contains(Vector3 point);public bool Contains(Vector3 point, bool allowInverse); |
++++[point]:点测试;
++++[allowInverse]:测试是否允许矩形的宽度和高度是负值;
++++返回值:如果该点在指定的矩形内返回true;
++++如果该点的x和y都在该矩形内返回true;如果当前是allowInverse和true,矩形的宽和高允许取负值(即,最小值大于最大值),并且测试依然运行;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{
void Update(){ var rect = new Rect(0, 0, 150, 150); if(rect.Contains(Input.mousePosition)){ Debug.Log(“立钻哥哥:Inside.”); } //立钻哥哥:if(){} } //立钻哥哥:void Update(){}
} //立钻哥哥:public class YanlzRect{} |
++D4.2、Overlaps |
public bool Overlaps(Rect other);public bool Overlaps(Rect other, bool allowInverse); |
++++[other]:其他矩形重叠;
++++[allowInverse]:是否允许矩形的宽和高值为负数;
++++如果其他的矩形重叠返回true;如果当前允许allowInverse并且值为true,矩形的宽度和高度可以取负值(即最小值大于最大值),那么测试仍然运行;
++D4.3、Set |
public void Set(float x, float y, float width, float height); |
++++设置现有的矩形的组件;
++D4.4、ToString |
public string ToString();public string ToString(string format); |
++++该矩形返回精确的格式化字符串;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzRect : MonoBehaviour{ public Rect rect = new Rect(0, 0, 10, 10);
void MyTestFunc(){ Debug.Log(rect); } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzRect{} |
#E5、Static Functions静态函数 |
++E5、Static Functions静态函数++++D5.1、MinMaxRect++++D5.2、NormalizedToPoint++++D5.3、PointToNormalized++++D5.4、YanlzXREngine.Rect.StaticFunctions |
++D5.1、MinMaxRect |
public static Rect MinMaxRect(float xmin, float ymin, float xmax, float ymax); |
++++[xmin]:The minimum X coordinate;
++++[ymin]:The minimum Y coordinate;
++++[xmax]:The minimum X coordinate;
++++[ymax]:The maximum Y coordinate;
++++匹配指定坐标的矩形;
++++根据min/max坐标值创建矩形;
++D5.2、NormalizedToPoint |
public static Vector2 NormalizedToPoint(Rect rectangle, Vector2 normalizedRectCoordinates); |
++++[rectangle]:矩形内点;
++++[normalizedRectCoordinates]:归一化获取的坐标;
++++返回矩形内一点,给定坐标归一化;
++D5.3、PointToNormalized |
public static Vector2 PointToNormalized(Rect rectangle, Vector2 point); |
++++[rectangle]:获取矩形内部归一化的坐标;
++++[point]:矩形内部的点到归一化的坐标;
++++返回归一化坐标相对应的点;
++++返回的Vector2值范围在0到1,或大于1或小于零;
#F6、Operators运算符 |
++F6、Operators运算符++++F6.1、operator!=++++F6.2、operator==++++F6.3、YanlzXREngine.Rect.Operators |
++F6.1、operator!= |
public static bool operator !=(Rect lhs, Rect rhs); |
++++如果矩形不同返回true;
++F6.2、operator== |
public static bool operator ==(Rect lhs, Rect rhs); |
++++如果矩形相同返回true;
#G7、立钻哥哥对Rect类的拓展 |
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html
++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html
++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html
++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html
++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/
立钻哥哥推荐的拓展学习链接(Link_Url) |
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/
++++虚拟现实VR资讯: https://blog.csdn.net/VRunSoftYanlz/article/details/89165846
++++HTC_VIVE开发基础:https://blog.csdn.net/VRunSoftYanlz/article/details/81989970
++++Oculus杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82469850
++++Oculus安装使用:https://blog.csdn.net/VRunSoftYanlz/article/details/82718982
++++Unity+SteamVR=>VR:https://blog.csdn.net/VRunSoftYanlz/article/details/88809370
++++Unity减少VR晕眩症:https://blog.csdn.net/VRunSoftYanlz/article/details/89115518
++++SteamVR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86484254
++++SteamVR脚本功能分析:https://blog.csdn.net/VRunSoftYanlz/article/details/86531480
++++SteamVR2.0开发指南:https://blog.csdn.net/VRunSoftYanlz/article/details/86618187
++++SteamVR2.2.0开发指南:https://blog.csdn.net/VRunSoftYanlz/article/details/88784527
++++SteamVR2.2.0快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/88833579
++++SteamVR2.2.0交互系统:https://blog.csdn.net/VRunSoftYanlz/article/details/89199778
++++SteamVR2.2.0传送机制:https://blog.csdn.net/VRunSoftYanlz/article/details/89390866
++++SteamVR2.2.0教程(一):https://blog.csdn.net/VRunSoftYanlz/article/details/89324067
++++SteamVR2.2.0教程(二):https://blog.csdn.net/VRunSoftYanlz/article/details/89894097
++++SteamVR_Skeleton_Poser:https://blog.csdn.net/VRunSoftYanlz/article/details/89931725
++++SteamVR实战之PMCore:https://blog.csdn.net/VRunSoftYanlz/article/details/89463658
++++SteamVR/Extras:https://blog.csdn.net/VRunSoftYanlz/article/details/86584108
++++SteamVR/Input:https://blog.csdn.net/VRunSoftYanlz/article/details/86601950
++++OpenXR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/85726365
++++VRTK杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82562993
++++VRTK快速入门(杂谈):https://blog.csdn.net/VRunSoftYanlz/article/details/82955267
++++VRTK官方示例(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82955410
++++VRTK代码结构(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82780085
++++VRTK(SceneResources):https://blog.csdn.net/VRunSoftYanlz/article/details/82795400
++++VRTK_ControllerEvents:https://blog.csdn.net/VRunSoftYanlz/article/details/83099512
++++VRTK_InteractTouch:https://blog.csdn.net/VRunSoftYanlz/article/details/83120220
++++虚拟现实行业应用:https://blog.csdn.net/VRunSoftYanlz/article/details/88360157
++++Steam平台上的VR:https://blog.csdn.net/VRunSoftYanlz/article/details/88960085
++++Steam平台热销VR:https://blog.csdn.net/VRunSoftYanlz/article/details/89007741
++++VR实验:以太网帧的构成:https://blog.csdn.net/VRunSoftYanlz/article/details/82598140
++++实验四:存储器扩展实验:https://blog.csdn.net/VRunSoftYanlz/article/details/87834434
++++FrameVR示例V0913:https://blog.csdn.net/VRunSoftYanlz/article/details/82808498
++++FrameVR示例V1003:https://blog.csdn.net/VRunSoftYanlz/article/details/83066516
++++SwitchMachineV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++PlaySceneManagerV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++Unity5.x用户手册:https://blog.csdn.net/VRunSoftYanlz/article/details/81712741
++++Unity面试题ABC:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++Unity面试题D:https://blog.csdn.net/VRunSoftYanlz/article/details/78630838
++++Unity面试题E:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity面试题F:https://blog.csdn.net/VRunSoftYanlz/article/details/78630945
++++Cocos2dx面试题:https://blog.csdn.net/VRunSoftYanlz/article/details/78630967
++++禅道[zentao]:https://blog.csdn.net/VRunSoftYanlz/article/details/83964057
++++Lua快速入门篇(Xlua拓展):https://blog.csdn.net/VRunSoftYanlz/article/details/81173818
++++Lua快速入门篇(XLua教程):https://blog.csdn.net/VRunSoftYanlz/article/details/81141502
++++Lua快速入门篇(基础概述):https://blog.csdn.net/VRunSoftYanlz/article/details/81041359
++++框架知识点:https://blog.csdn.net/VRunSoftYanlz/article/details/80862879
++++游戏框架(UI框架夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80781140
++++游戏框架(初探篇):https://blog.csdn.net/VRunSoftYanlz/article/details/80630325
++++.Net框架设计:https://blog.csdn.net/VRunSoftYanlz/article/details/87401225
++++从零开始学架构:https://blog.csdn.net/VRunSoftYanlz/article/details/88095895
++++设计模式简单整理:https://blog.csdn.net/vrunsoftyanlz/article/details/79839641
++++专题:设计模式(精华篇):https://blog.csdn.net/VRunSoftYanlz/article/details/81322678
++++U3D小项目参考:https://blog.csdn.net/vrunsoftyanlz/article/details/80141811
++++Unity小游戏算法分析:https://blog.csdn.net/VRunSoftYanlz/article/details/87908365
++++Unity案例(Vehicle):https://blog.csdn.net/VRunSoftYanlz/article/details/82355876
++++UML类图:https://blog.csdn.net/vrunsoftyanlz/article/details/80289461
++++PowerDesigner简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86500084
++++Unity知识点0001:https://blog.csdn.net/vrunsoftyanlz/article/details/80302012
++++Unity知识点0008:https://blog.csdn.net/VRunSoftYanlz/article/details/81153606
++++U3D_Shader编程(第一篇:快速入门篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372071
++++U3D_Shader编程(第二篇:基础夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372628
++++Unity引擎基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78881685
++++Unity面向组件开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78881752
++++Unity物理系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78881879
++++Unity2D平台开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78882034
++++UGUI基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78884693
++++UGUI进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78884882
++++UGUI综合:https://blog.csdn.net/vrunsoftyanlz/article/details/78885013
++++Unity动画系统基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78886068
++++Unity动画系统进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78886198
++++Navigation导航系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78886281
++++Unity特效渲染:https://blog.csdn.net/vrunsoftyanlz/article/details/78886403
++++Unity数据存储:https://blog.csdn.net/vrunsoftyanlz/article/details/79251273
++++Unity中Sqlite数据库:https://blog.csdn.net/vrunsoftyanlz/article/details/79254162
++++WWW类和协程:https://blog.csdn.net/vrunsoftyanlz/article/details/79254559
++++Unity网络:https://blog.csdn.net/vrunsoftyanlz/article/details/79254902
++++Unity资源加密:https://blog.csdn.net/VRunSoftYanlz/article/details/87644514
++++PhotonServer简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86652770
++++编写Photon游戏服务器:https://blog.csdn.net/VRunSoftYanlz/article/details/86682935
++++C#事件:https://blog.csdn.net/vrunsoftyanlz/article/details/78631267
++++C#委托:https://blog.csdn.net/vrunsoftyanlz/article/details/78631183
++++C#集合:https://blog.csdn.net/vrunsoftyanlz/article/details/78631175
++++C#泛型:https://blog.csdn.net/vrunsoftyanlz/article/details/78631141
++++C#接口:https://blog.csdn.net/vrunsoftyanlz/article/details/78631122
++++C#静态类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630979
++++C#中System.String类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630945
++++C#数据类型:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity3D默认的快捷键:https://blog.csdn.net/vrunsoftyanlz/article/details/78630838
++++游戏相关缩写:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++UnityAPI.Rigidbody刚体:https://blog.csdn.net/VRunSoftYanlz/article/details/81784053
++++UnityAPI.Material材质:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303
++++UnityAPI.Android安卓:https://blog.csdn.net/VRunSoftYanlz/article/details/81843193
++++UnityAPI.AndroidJNI安卓JNI:https://blog.csdn.net/VRunSoftYanlz/article/details/81879345
++++UnityAPI.Transform变换:https://blog.csdn.net/VRunSoftYanlz/article/details/81916293
++++UnityAPI.WheelCollider轮碰撞器:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217
++++UnityAPI.Resources资源:https://blog.csdn.net/VRunSoftYanlz/article/details/83155518
++++JSON数据结构:https://blog.csdn.net/VRunSoftYanlz/article/details/82026644
++++CocosStudio快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/82356839
++++Unity企业内训(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82634668
++++Unity企业内训(第1讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82634733
++++Unity企业内训(第2讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82861180
++++Unity企业内训(第3讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82927699
++++Unity企业内训(第4讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83479776
++++Unity企业内训(第5讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83963811
++++Unity企业内训(第6讲):https://blog.csdn.net/VRunSoftYanlz/article/details/84207696
++++钻哥带您了解产品原型:https://blog.csdn.net/VRunSoftYanlz/article/details/87303828
++++插件
++++计算机组成原理(教材篇):https://blog.csdn.net/VRunSoftYanlz/article/details/82719129
++++5G接入:云计算和雾计算:https://blog.csdn.net/VRunSoftYanlz/article/details/88372718
++++云计算通俗讲义:https://blog.csdn.net/VRunSoftYanlz/article/details/88652803
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz
--_--VRunSoft:lovezuanzuan--_--
--_--VRunSoft:lovezuanzuan--_--