4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx

上传人:b****3 文档编号:17561826 上传时间:2022-12-07 格式:DOCX 页数:39 大小:2.33MB
下载 相关 举报
4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx_第1页
第1页 / 共39页
4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx_第2页
第2页 / 共39页
4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx_第3页
第3页 / 共39页
4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx_第4页
第4页 / 共39页
4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx_第5页
第5页 / 共39页
点击查看更多>>
下载资源
资源描述

4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx

《4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx(39页珍藏版)》请在冰豆网上搜索。

4SearchingprefablightcameraparticlesystemterrainWord文档下载推荐.docx

SceneViewandHierarchywithactivefilteringofsearchterm.

Whenasearchtermfilterisactive,theHierarchydoesn'

tshowhierarchicalrelationshipsbetweenGameObjects,butyoucanselectanyGameObject,andit'

shierarchicalpathinthescenewillbeshownatthebottomoftheHierarchy.

ClickonaGameObjectinthefilteredlisttoseeitshierarchicalpath.

Whenyouwanttoclearthesearchfilter,justclickthesmallcrossinthesearchfield.

IntheScenesearchyoucansearcheitherbyNameorbyType.Clickonthesmallmagnifyingglassinthesearchfieldtoopenthesearchdrop-downmenuandchoosethesearchmode.

SearchbyName,Type,orAll.

ProjectSearch

ThesamefundamentalsapplytosearchingofassetsintheProjectView--justtypeinyoursearchtermandyou'

llseealltherelevantassetsappearinthefilter.

IntheProjectsearchyoucansearchbyNameorbyTypeasintheScenesearch,andadditionallyyoucansearchbyLabel.Clickonthesmallmagnifyingglassinthesearchfieldtoopenthesearchdrop-downmenuandchoosethesearchmode.

SearchbyName,Type,Label,orAll.

ObjectPickerSeach

WhenassigninganobjectviatheObjectPicker,youcanalsotypeinanysearchtermsearchtofilterdowntoonlytheobjectsyouwanttosee.

●Prefabs

APrefabisatypeofasset--areusableGameObjectstoredinProjectView.Prefabscanbeinsertedintoanynumberofscenes,multipletimesperscene.WhenyouaddaPrefabtoascene,youcreateaninstanceofit.AllPrefabinstancesarelinkedtotheoriginalPrefabandareessentiallyclonesofit.Nomatterhowmanyinstancesexistinyourproject,whenyoumakeanychangestothePrefabyouwillseethechangeappliedtoallinstances.

CreatingPrefabs

InordertocreateaPrefab,youmustmakeanewblankPrefabusingthemenu.ThisblankPrefabcontainsnoGameObjects,andyoucannotcreateaninstanceofit.ThinkofanewPrefabasanemptycontainer,waitingtobefilledwithGameObjectdata.

Anew,emptyPrefab.ItcannotbeinstanceduntilyoufillitwithaGameObject.

TofillthePrefab,youuseaGameObjectthatyou'

vecreatedinthescene.

1.ChooseAssets->

Create->

PrefabfromthemenubarandnameyournewPrefab.

2.InHierarchyView,selecttheGameObjectyouwishtomakeintoaPrefab.

3.Drag&

droptheGameObjectfromtheHierarchyontothenewPrefabinProjectView.

Afteryouhaveperformedthesesteps,theGameObjectandallitschildrenhavebeencopiedintothePrefabdata.ThePrefabcannowbere-usedinmultipleinstances.TheoriginalGameObjectintheHierarchyhasnowbecomeaninstanceofthePrefab.

PrefabInstances

TocreateaPrefabinstanceinthecurrentscene,dragthePrefabfromtheProjectViewintotheSceneorHierarchyView.ThisinstanceislinkedtothePrefab,asdisplayedbythebluetextusedfortheirnameintheHierarchyView.

ThreeoftheseGameObjectsarelinkedtoPrefabs.Oneofthemisnot.

∙IfyouhaveselectedaPrefabinstance,andwanttomakeachangethataffectsallinstances,youcanclicktheSelectbuttonintheInspectortoselectthesourcePrefab.

∙InformationaboutinstantiatingprefabsfromscriptsisintheInstantiatingPrefabspage.

Inheritance

InheritancemeansthatwheneverthesourcePrefabchanges,thosechangesareappliedtoalllinkedGameObjects.Forexample,ifyouaddanewscripttoaPrefab,allofthelinkedGameObjectswillinstantlycontainthescriptaswell.However,itispossibletochangethepropertiesofasingleinstancewhilekeepingthelinkintact.Simplychangeanypropertyofaprefabinstance,andwatchasthevariablenamebecomesbold.Thevariableisnowoverridden.AlloverriddenpropertieswillnotbeaffectedbychangesinthesourcePrefab.

ThisallowsyoutomodifyPrefabinstancestomakethemuniquefromtheirsourcePrefabswithoutbreakingthePrefablink.

AlinkedGameObjectwithnooverridesenabled.

AlinkedGameObjectwithseveral(bold)overridesenabled.

∙IfyouwanttoupdatethesourcePrefabandallinstanceswiththenewoverriddenvalues,youcanclicktheApplybuttonintheInspector.

∙Ifyouwanttodiscardalloverridesonaparticularinstance,youcanclicktheRevertbutton.

BreakingandRestoringPrefabLinks

Therearecertainactionswhichwillbreakthelinkbetweenasingleinstanceanditssourceprefab,butthelinkcanalwaysberestored.Actionsthatwillbreakthelink:

∙AddingorremovingaComponent

∙AddingorremovingachildGameObject

Theseactionswillpromptawarning/confirmationmessageaboutbreakingthelink.ConfirmingtheactionwillbreakthelinksochangestothesourcePrefabwillnolongeraffectthebrokeninstance.Torestorethelink,youcanclickeithertheReconnectorApplybuttonsintheInspectoroftheinstance.

∙ReconnectwilldiscardalldifferencesfromthesourcePrefab.

∙ApplywillcopyalldifferencesintothesourcePrefab(andtherefore,allotherPrefabinstances)

ImportedPrefabs

WhenyouplaceameshassetintoyourAssetsfolder,UnityautomaticallyimportsthefileandgeneratessomethingthatlookssimilartoaPrefaboutofthemesh.ThisisnotactuallyaPrefab,itissimplytheassetfileitself.InstancingandworkingwithassetsintroducessomelimitationsthatarenotpresentwhenworkingwithnormalPrefabs.

NoticetheasseticonisabitdifferentfromthePrefabicons

TheassetisinstantiatedinthesceneasaGameObject,linkedtothesourceassetinsteadofanormalPrefab.ComponentscanbeaddedandremovedfromthisGameObjectasnormal.However,youcannotapplyanychangestotheassetitselfsincethiswouldadddatatotheassetfileitself!

Ifyou'

recreatingsomethingyouwanttore-use,youshouldmaketheassetinstanceintoaPrefabfollowingthestepslistedaboveunder"

CreatingPrefabs"

.

∙Whenyouhaveselectedaninstanceofanasset,theApplybuttonintheInspectorisreplacedwithanEditbutton.Clickingthisbuttonwilllaunchtheeditingapplicationforyourasset(e.g.MayaorMax).

●Lights

Lightsareanessentialpartofeveryscene.Whilemeshesandtexturesdefinetheshapeandlookofascene,lightsdefinethecolorandmoodofyour3Denvironment.You'

lllikelyworkwithmorethanonelightineachscene.Makingthemworktogetherrequiresalittlepracticebuttheresultscanbequiteamazing.

Asimple,two-lightsetup

LightscanbeaddedtoyourscenefromtheGameObject->

CreateOthermenu.Therearethreetypesoflightswhichwe'

lldiscussinamoment.Oncealighthasbeenadded,youcanmanipulateitlikeanyotherGameObject.Additionally,youcanaddaLightComponenttoanyselectedGameObjectbyusingComponent->

Rendering->

Light.

TherearemanydifferentoptionswithintheLightComponentintheInspector.

LightComponentpropertiesintheInspector

BysimplychangingtheColorofalight,youcangiveawholedifferentmoodtothescene.

Bright,sunnylights

Dark,medievallights

Spookynightlights

Thelightsyoucreatethiswayarerealtimelights-theirlightingiscalculatedeachframewhilethegameisrunning.Ifyouknowthelightwillnotchange,youcanmakeyourgamefasterandlookmuchbetterbyusingLightmapping.

Renderingpaths

UnitysupportsdifferentRenderingPaths,thesepathsaffectmainlyLightsandShadows,sochoosingthecorrectrenderingpathdependingonyourgamerequirementscanimproveyourproject'

sperformance.FormoreinfoaboutrenderingpathsyoucanvisittheRenderingpathssection.

Moreinformation

FormoreinformationaboutusingLights,checktheLightspageintheReferenceManual.

●Cameras

Justascamerasareusedinfilmstodisplaythestorytotheaudience,CamerasinUnityareusedtodisplaythegameworldtotheplayer.Youwillalwayshaveatleastonecamerainascene,butyoucanhavemorethanone.Multiplecamerascangiveyouatwo-playersplitscreenorcreateadvancedcustomeffects.Youcananimatecameras,orcontrolthemwithphysics.Practicallyanythingyoucanimagineispossiblewithcameras,andyoucanusetypicaloruniquecamerastofityourgame'

sstyle.

TheremainingtextisfromtheCameraComponentreferencepage.

Camera

Camerasarethedevicesthatcaptureanddisplaytheworldtotheplayer.Bycustomizingandmanipulatingcameras,youcanmakethepresentationofyourgametrulyunique.Youcanhaveanunlimitednumberofcamerasinascene.Theycanbesettorenderinanyorder,atanyplaceonthescreen,oronlycertainpartsofthescreen.

Unity'

sflexibleCameraobject

Properties

ClearFlags

Determineswhichpartsofthescreenwillbecleared.ThisishandywhenusingmultipleCamerastodrawdifferentgameelements.

Ba

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 小升初

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1