UGUI综合

UGUI综合

##1UGUI背包系统数据库

++1.1UGUI背包系统编程

++++1UGUI应用最多的地方就是背包系统,其综合性比较强,背包系统作好了,其移植和重用性都比较好。设计模式

++++2、背包里面最重要的功能是鼠标拖动物品应用到角色身上,以及物品与物品之间的交换。浏览器

++++3UGUI在游戏中实现“商店”方面用得也比较多。缓存


++1.2UI层级结构网络

++++UI层级:异步

--Knapsack背包使用网格布局。布局

--item用来存放物品,经过鼠标拖动,改变其父物体和位置。学习

--cellImage控件,做为物品的父物体,用于交换和移动物品。动画

--Mall商城,能够上下滑动。

--Equip,全部的物品经过脚本加载。


++1.3Canvas Group的做用

++++当一个控件盖到另一个控件上的时候,下面的控件默认是不检测的,为了能够透过当前控件检测到下面的控件,能够给该组件添加CanvasGroup组件。

++++其属性BlocksRaycasts设置为false时表示能够穿透该控件检测到下面的控件,若是为true表示不能穿透,下方的控件检测不到。


##2UGUI小地图

++2.1UGUI实现小地图效果

++++1、使用另一个摄像机渲染整个场景,获得摄像机渲染的纹理;

++++2、设置摄像机的Culling Mask渲染不一样的层。

++++3、建立RawImage控件并加上纹理并进行圆形遮罩;


++2.2、小地图制做过程

++++1、制做过程一:

--Player 玩家对象

--主摄像机: 渲染场景和Player。(渲染除mask层的游戏物体)

--地图相机: 渲染场景和Player上的Mark。(渲染除player层的游戏物体)

--Mark:小地图中人物的标记。(设置Player所在的层)

++思考:

  --1、如何将游戏物体的阴影隐藏?

  --2、相机的Depth(深度)的做用?


++++2、小地图制做过程二:

--将渲染小地图相机的深度值修改比主相机的小。

--Assets文件夹中建立RenderTexture

--指定Map Camera中的Target Texture为刚刚建立的MiniMapTextureMiniMap Texture接收Map Camera渲染的画面。


++++3、小地图制做过程三

--背景图片

--添加遮罩组件

--MapCamera摄像机渲染的图片拖到此位置,显示到UI上。


##3Application类,SceneManager

++3.1、应用程序简介

++++1、应用程序是指为了完成某项或某几项特定任务而被开发运行于操做系统之上的计算机程序。

++++2、应用程序(Application)运行在用户模式,它能够和用户进行交互,具备可视的用户界面。

++++3、工程(Project)是面向开发者的,二者之间是一一对应的。

++3.2Application

++++Unity中,全部与应用程序相关的方法都写在Application类中。

++++主要功能:获取或设置当前应用程序的一些属性。

--加载有关卡场景。

--获取资源文件路径。

--退出当前游戏程序。

--获取当前游戏平台。

--获取数据文件夹路径。

++++Application类经常使用的变量和方法:

--platform :返回游戏运行平台。

--runInBackground :应用程序是否在后台运行。

--dataPath :游戏数据文件夹的路径。

--persistentDataPath :一个持久数据目录的路径。

--temporaryCachePath :临时数据/缓存目录的路径。

--loadedLevel :加载的关卡(场景)索引。

--OpenURL :在当前设备中调用浏览器打开网页。

--Quit :退出应用程序。

++3.3、场景切换

++++同步加载场景的方式分为两种:

--1、读取新关卡后当即切换,其参数为所读取新关卡的名称或索引。

    ---SceneManager.LoadScene(“Scene2”);

--2、加载一个新的场景,当前场景不会被销毁。

    ---SceneManager.LoadScene(“Scene2”, LoadSceneMode.Additive);

++++异步加载场景的方式分为两种:

--1、异步加载新游戏场景,当新场景加载完成后进入新场景而且销毁以前的场景。

    ---SceneManager.LoadSceneAsync(“Scene2”);

--2、一样异步加载新场景,新场景加载完毕后,保留以前场景而且进入新场景。

    ---SceneManager.LoadSceneAsync(“Scene2”, LoadSceneMode.Additive);

++++场景导出:【Assets=>Export Package...

--小贴士: 场景导出的时候会将当前场景用到的全部资源都导出。



++4.4、工程发布




#立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/

++立钻哥哥推荐的拓展学习连接(Link_Url

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/

++++Unity引擎基础http://www.javashuo.com/article/p-beommoeb-ka.html

++++Unity面向组件开发http://www.javashuo.com/article/p-eigmuvut-dt.html

++++Unity物理系统http://www.javashuo.com/article/p-nqvvciwv-kd.html

++++Unity2D平台开发http://www.javashuo.com/article/p-ycaagdtj-hs.html

++++UGUI基础http://www.javashuo.com/article/p-rukxwckw-mc.html

++++UGUI进阶http://www.javashuo.com/article/p-wcatruhq-gt.html

++++UGUI综合http://www.javashuo.com/article/p-dkccmqii-gg.html

++++Unity动画系统基础http://www.javashuo.com/article/p-mbrdouxy-dq.html

++++Unity动画系统进阶http://www.javashuo.com/article/p-aqaqpbkh-bp.html

++++Navigation导航系统http://www.javashuo.com/article/p-dswwllas-t.html

++++Unity特效渲染http://www.javashuo.com/article/p-ckojjyfj-bp.html

++++Unity数据存储http://www.javashuo.com/article/p-bvlzynso-m.html

++++Unity中Sqlite数据库http://www.javashuo.com/article/p-ejutsbxl-ca.html

++++WWW类和协程http://www.javashuo.com/article/p-dbwmhsav-cy.html

++++Unity网络http://www.javashuo.com/article/p-sqrlntgh-dw.html

++++C#事件http://www.javashuo.com/article/p-zmwruvql-gm.html

++++C#委托http://www.javashuo.com/article/p-uozpymaf-gh.html

++++C#集合http://www.javashuo.com/article/p-sfqfdqsf-ex.html

++++C#泛型http://www.javashuo.com/article/p-xrttqngo-ee.html

++++C#接口http://www.javashuo.com/article/p-vhlfplgv-dm.html

++++C#静态类https://blog.csdn.net/vrunsoftyanlz/article/details/78630979

++++C#中System.String类http://www.javashuo.com/article/p-olslkfao-cq.html

++++C#数据类型http://www.javashuo.com/article/p-hmabbtmc-ba.html

++++Unity3D默认的快捷键http://www.javashuo.com/article/p-wuwcrclr-s.html

++++游戏相关缩写http://www.javashuo.com/article/p-mwacxwca-gm.html

++++设计模式简单整理http://www.javashuo.com/article/p-rngqugib-hg.html

++++U3D小项目参考https://blog.csdn.net/vrunsoftyanlz/article/details/80141811

++++UML类图http://www.javashuo.com/article/p-sxberuew-bm.html

++++Unity知识点0001http://www.javashuo.com/article/p-ryvdxxjr-ep.html

++++U3D_Shader编程(第一篇:快速入门篇)http://www.javashuo.com/article/p-kyppgrac-gz.html

++++U3D_Shader编程(第二篇:基础夯实篇)http://www.javashuo.com/article/p-qkyowtli-hv.html

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/


--_--VRunSoft : Lovezuanzuan--_--