翻译的英文原文.docx
《翻译的英文原文.docx》由会员分享,可在线阅读,更多相关《翻译的英文原文.docx(11页珍藏版)》请在冰点文库上搜索。
翻译的英文原文
本科毕业论文(设计)
英文文献中文翻译
文献中文题目Unity指南
学生姓名
学号
所在学院
专业
班级
指导教师
2013年12月
成都信息工程学院计算机学院
Unity指南
Unity团队
UnityManual
UnityTeam
WelcometoUnity.
Unityismadetoempoweryoutocreatethebestinteractiveentertainmentormultimediaexperiencethatyoucan.ThismanualisdesignedtohelpyoulearnhowtouseUnity,frombasictoadvancedtechniques.Itcanbereadfromstarttofinishorusedasareference.
Themanualisdividedintodifferentsections.Thefirstsection,UserGuide,isanintroductiontoUnity'sinterface,assetworkflow,andthebasicsofbuildingagame.IfyouarenewtoUnity,youshouldstartbyreadingtheUnityBasicssubsection.
Thenextsection,FAQ,isacollectionoffrequentlyaskedquestionsaboutperformingcommontasksthatrequireafewsteps.
Thelastsection,Advanced,addressestopicssuchasgameoptimization,shaders,filesizes,anddeployment.
Whenyou'vefinishedreading,takealookattheReferenceManualandtheScriptingReferenceforfurtherdetailsaboutthedifferentpossibilitiesofconstructingyourgameswithUnity.
IfyoufindthatanyquestionyouhaveisnotansweredinthismanualpleaseaskonUnityAnswersorUnityForums.Youwillbeabletofindyouranswerthere.
TheUnityManualGuidecontainssomesectionsthatapplyonlytocertainplatforms.Pleaseselectwhichplatformsyouwanttosee.Platform-specificinformationcanalwaysbeseenbyclickingonthedisclosuretrianglesoneachpage.
GameObjects
GameObjectsarethemostimportantobjectsinUnity.ItisveryimportanttounderstandwhataGameObjectis,andhowitcanbeused.Thispagewillexplainallthatforyou.
WhatareGameObjects?
EveryobjectinyourgameisaGameObject.However,GameObjectsdon'tdoanythingontheirown.Theyneedspecialpropertiesbeforetheycanbecomeacharacter,anenvironment,oraspecialeffect.Buteveryoneoftheseobjectsdoessomanydifferentthings.IfeveryobjectisaGameObject,howdowedifferentiateaninteractivepower-upobjectfromastaticroom?
WhatmakestheseGameObjectsdifferentfromeachother?
TheanswertothisquestionisthatGameObjectsarecontainers.Theyareemptyboxeswhichcanholdthedifferentpiecesthatmakeupalightmappedislandoraphysics-drivencar.SotoreallyunderstandGameObjects,youhavetounderstandthesepieces;theyarecalledComponents.Dependingonwhatkindofobjectyouwanttocreate,youwilladddifferentcombinationsofComponentstotheGameObject.ThinkofaGameObjectasanemptycookingpot,andComponentsasdifferentingredientsthatmakeupyourrecipeofgameplay.YoucanalsomakeyourownComponentsusingScripts.
YoucanreadmoreaboutGameObjects,Components,andScriptComponentsonthepagesinthissection:
∙TheGameObject-ComponentRelationship
∙UsingComponents
∙TheComponent-ScriptRelationship
∙DeactivatingGameObjects
TheGameObject-ComponentRelationship
AsdescribedpreviouslyinGameObjects,aGameObjectcontainsComponents.We'llexplorethisrelationshipbydiscussingaGameObjectanditsmostcommonComponent--theTransformComponent.WithanyUnitySceneopen,createanewGameObject(usingShift-Control-NonWindowsorShift-Command-NonMac),selectitandtakealookattheInspector.
TheInspectorofanEmptyGameObject
NoticethatanemptyGameObjectstillcontainsaName,aTag,andaLayer.EveryGameObjectalsocontainsaTransformComponent.
TheTransformComponent
ItisimpossibletocreateaGameObjectinUnitywithoutaTransformComponent.TheTransformComponentisoneofthemostimportantComponents,sincealloftheGameObject'sTransformpropertiesareenabledbyitsuseofthisComponent.ItdefinestheGameObject'sposition,rotation,andscaleinthegameworld/SceneView.IfaGameObjectdidnothaveaTransformComponent,itwouldbenothingmorethansomeinformationinthecomputer'smemory.Iteffectivelywouldnotexistintheworld.
TheTransformComponentalsoenablesaconceptcalledParenting,whichisutilizedthroughtheUnityEditorandisacriticalpartofworkingwithGameObjects.TolearnmoreabouttheTransformComponentandParenting,readtheTransformComponentReferencepage.
OtherComponents
TheTransformComponentiscriticaltoallGameObjects,soeachGameObjecthasone.ButGameObjectscancontainotherComponentsaswell.
TheMainCamera,addedtoeachscenebydefault
LookingattheMainCameraGameObject,youcanseethatitcontainsadifferentcollectionofComponents.Specifically,aCameraComponent,aGUILayer,aFlareLayer,andanAudioListener.AlloftheseComponentsprovideadditionalfunctionalitytotheGameObject.Withoutthem,therewouldbenothingrenderingthegraphicsofthegameforthepersonplaying!
Rigidbodies,Colliders,Particles,andAudioarealldifferentComponents(orcombinationsofComponents)thatcanbeaddedtoanygivenGameObject.
UsingComponents
Componentsarethenuts&boltsofobjectsandbehaviorsinagame.TheyarethefunctionalpiecesofeveryGameObject.Ifyoudon'tyetunderstandtherelationshipbetweenComponentsandGameObjects,readtheGameObjectspagebeforegoinganyfurther.
AGameObjectisacontainerformanydifferentComponents.Bydefault,allGameObjectsautomaticallyhaveaTransformComponent.ThisisbecausetheTransformdictateswheretheGameObjectislocated,andhowitisrotatedandscaled.WithoutaTransformComponent,theGameObjectwouldn'thavealocationintheworld.TrycreatinganemptyGameObjectnowasanexample.ClicktheGameObject->CreateEmptymenuitem.SelectthenewGameObject,andlookattheInspector.
EvenemptyGameObjectshaveaTransformComponent
RememberthatyoucanalwaysusetheInspectortoseewhichComponentsareattachedtotheselectedGameObject.AsComponentsareaddedandremoved,theInspectorwillalwaysshowyouwhichonesarecurrentlyattached.YouwillusetheInspectortochangeallthepropertiesofanyComponent(includingscripts)
AddingComponents
YoucanaddComponentstotheselectedGameObjectthroughtheComponentsmenu.We'lltrythisnowbyaddingaRigidbodytotheemptyGameObjectwejustcreated.SelectitandchooseComponent->Physics->Rigidbodyfromthemenu.Whenyoudo,youwillseetheRigidbody'spropertiesappearintheInspector.IfyoupressPlaywhiletheemptyGameObjectisstillselected,youmightgetalittlesurprise.TryitandnoticehowtheRigidbodyhasaddedfunctionalitytotheotherwiseemptyGameObject.(They-componentoftheGameObjectstartstodecrease.ThisisbecausethephysicsengineinUnityiscausingtheGameObjecttofallundergravity.)
AnemptyGameObjectwithaRigidbodyComponentattached
AnotheroptionistousetheComponentBrowser,whichcanbeactivatedwiththeAddComponentbuttonintheobject'sInspector.
Thebrowserletsyounavigatethecomponentsconvenientlybycategoryandalsohasasearchboxthatyoucanusetolocatecomponentsbyname.
YoucanattachanynumberorcombinationofComponentstoasingleGameObject.SomeComponentsworkbestincombinationwithothers.Forexample,theRigidbodyworkswithanyCollider.TheRigidbodycontrolstheTransformthroughtheNVIDIAPhysXphysicsengine,andtheColliderallowstheRigidbodytocollideandinteractwithotherColliders.
IfyouwanttoknowmoreaboutusingaparticularComponent,youcanreadaboutanyofthemintheComponentReference.YoucanalsoaccessthereferencepageforaComponentfromUnitybyclickingonthesmall?
ontheComponent'sheaderintheInspector.
EditingComponents
OneofthegreataspectsofComponentsisflexibility.WhenyouattachaComponenttoaGameObject,therearedifferentvaluesorPropertiesintheComponentthatcanbeadjustedintheeditorwhilebuildingagame,orbyscriptswhenrunningthegame.TherearetwomaintypesofProperties:
ValuesandReferences.
Lookattheimagebelow.ItisanemptyGameObjectwithanAudioSourceComponent.AllthevaluesoftheAudioSourceintheInspectorarethedefaultvalues.
ThisComponentcontainsasingleReferenceproperty,andsevenValueproperties.AudioClipistheReferenceproperty.WhenthisAudioSourcebeginsplaying,itwillattempttoplaytheaudiofilethatisreferencedintheAudioClipproperty.Ifnoreferenceismade,anerrorwilloccurbecausethereisnoaudiotobeplayed.YoumustreferencethefilewithintheInspector.ThisisaseasyasdragginganaudiofilefromtheProjectViewontotheReferencePropertyorusingtheObjectSelector.
NowasoundeffectfileisreferencedintheAudioClipproperty
ComponentscanincludereferencestoanyothertypeofComponent,GameObjects,orAssets.YoucanreadmoreaboutassigningreferencesontheAssigningReferencespage.
TheremainingpropertiesontheAudioClipareallValueproperties.ThesecanbeadjusteddirectlyintheInspector.TheValuepropertiesontheAudioCliparealltoggles,numericvalues,drop-downfields,butvaluepropertiescanalsobetextstrings,colors,curves,andothertypes.YoucanreadmoreabouttheseandabouteditingvaluepropertiesontheEditingValuePropertiespage.
CopyingandpastingComponentsettings
ThecontextmenuforaComponenthasitemsforcopyingandpastingitssettings.
ThecopiedvaluescanbepastedtoanexistingcomponentusingthePasteComponentValuesmenuitem.Alternatively,youcanusePasteComponentAsNewtocreateanewComponentwiththosevalues.
TestingoutProperties
WhileyourgameisinPlayMode,youarefreetochangepropertiesinanyGameObject'sInspector.Forexample,youmightwanttoexperimentwithdifferentheightsofjumping.IfyoucreateaJumpHeightpropertyinascript,youcanenterPlayMode,changet