Ai
1 Star 0 Fork 3

wayfarer/rongYaoDaLuCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
iTween.cs 177.91 KB
一键复制 编辑 原始数据 按行查看 历史
liyonghelpme 提交于 2015-05-19 23:14 +08:00 . rong Yao Da Lu Some Code For Game
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using UnityEngine;
public class iTween : MonoBehaviour
{
public string _name;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map29;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map2A;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map2B;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map2C;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map2D;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map2E;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map2F;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map30;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map31;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map32;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map33;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map34;
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map35;
private ApplyTween apply;
private AudioSource audioSource;
private static GameObject cameraFade;
private Color[,] colors;
public float delay;
private float delayStarted;
private EasingFunction ease;
public EaseType easeType;
private float[] floats;
public string id;
private bool isLocal;
public bool isPaused;
public bool isRunning;
private bool kinematic;
private float lastRealTime;
private bool loop;
public LoopType loopType;
public string method;
private NamedValueColor namedcolorvalue;
private CRSpline path;
private float percentage;
private bool physics;
private Vector3 postUpdate;
private Vector3 preUpdate;
private Rect[] rects;
private bool reverse;
private float runningTime;
private Space space;
public float time;
private Hashtable tweenArguments;
public static ArrayList tweens = new ArrayList();
public string type;
private bool useRealTime;
private Vector2[] vector2s;
private Vector3[] vector3s;
private bool wasPaused;
private void ApplyAudioToTargets()
{
this.vector2s[2].x = this.ease(this.vector2s[0].x, this.vector2s[1].x, this.percentage);
this.vector2s[2].y = this.ease(this.vector2s[0].y, this.vector2s[1].y, this.percentage);
this.audioSource.volume = this.vector2s[2].x;
this.audioSource.pitch = this.vector2s[2].y;
if (this.percentage == 1f)
{
this.audioSource.volume = this.vector2s[1].x;
this.audioSource.pitch = this.vector2s[1].y;
}
}
private void ApplyColorTargets()
{
this.colors[0, 2].r = this.ease(this.colors[0, 0].r, this.colors[0, 1].r, this.percentage);
this.colors[0, 2].g = this.ease(this.colors[0, 0].g, this.colors[0, 1].g, this.percentage);
this.colors[0, 2].b = this.ease(this.colors[0, 0].b, this.colors[0, 1].b, this.percentage);
this.colors[0, 2].a = this.ease(this.colors[0, 0].a, this.colors[0, 1].a, this.percentage);
this.tweenArguments["onupdateparams"] = this.colors[0, 2];
if (this.percentage == 1f)
{
this.tweenArguments["onupdateparams"] = this.colors[0, 1];
}
}
private void ApplyColorToTargets()
{
for (int i = 0; i < this.colors.GetLength(0); i++)
{
this.colors[i, 2].r = this.ease(this.colors[i, 0].r, this.colors[i, 1].r, this.percentage);
this.colors[i, 2].g = this.ease(this.colors[i, 0].g, this.colors[i, 1].g, this.percentage);
this.colors[i, 2].b = this.ease(this.colors[i, 0].b, this.colors[i, 1].b, this.percentage);
this.colors[i, 2].a = this.ease(this.colors[i, 0].a, this.colors[i, 1].a, this.percentage);
}
if (base.GetComponent(typeof(GUITexture)) != null)
{
base.guiTexture.color = this.colors[0, 2];
}
else if (base.GetComponent(typeof(GUIText)) != null)
{
base.guiText.material.color = this.colors[0, 2];
}
else if (base.renderer != null)
{
for (int j = 0; j < this.colors.GetLength(0); j++)
{
base.renderer.materials[j].SetColor(this.namedcolorvalue.ToString(), this.colors[j, 2]);
}
}
else if (base.light != null)
{
base.light.color = this.colors[0, 2];
}
if (this.percentage == 1f)
{
if (base.GetComponent(typeof(GUITexture)) != null)
{
base.guiTexture.color = this.colors[0, 1];
}
else if (base.GetComponent(typeof(GUIText)) != null)
{
base.guiText.material.color = this.colors[0, 1];
}
else if (base.renderer != null)
{
for (int k = 0; k < this.colors.GetLength(0); k++)
{
base.renderer.materials[k].SetColor(this.namedcolorvalue.ToString(), this.colors[k, 1]);
}
}
else if (base.light != null)
{
base.light.color = this.colors[0, 1];
}
}
}
private void ApplyFloatTargets()
{
this.floats[2] = this.ease(this.floats[0], this.floats[1], this.percentage);
this.tweenArguments["onupdateparams"] = this.floats[2];
if (this.percentage == 1f)
{
this.tweenArguments["onupdateparams"] = this.floats[1];
}
}
private void ApplyLookToTargets()
{
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
if (this.isLocal)
{
base.transform.localRotation = Quaternion.Euler(this.vector3s[2]);
}
else
{
base.transform.rotation = Quaternion.Euler(this.vector3s[2]);
}
}
private void ApplyMoveByTargets()
{
this.preUpdate = base.transform.position;
Vector3 eulerAngles = new Vector3();
if (this.tweenArguments.Contains("looktarget"))
{
eulerAngles = base.transform.eulerAngles;
base.transform.eulerAngles = this.vector3s[4];
}
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
base.transform.Translate(this.vector3s[2] - this.vector3s[3], this.space);
this.vector3s[3] = this.vector3s[2];
if (this.tweenArguments.Contains("looktarget"))
{
base.transform.eulerAngles = eulerAngles;
}
this.postUpdate = base.transform.position;
if (this.physics)
{
base.transform.position = this.preUpdate;
base.rigidbody.MovePosition(this.postUpdate);
}
}
private void ApplyMoveToPathTargets()
{
this.preUpdate = base.transform.position;
float num = this.ease(0f, 1f, this.percentage);
if (this.isLocal)
{
base.transform.localPosition = this.path.Interp(Mathf.Clamp(num, 0f, 1f));
}
else
{
base.transform.position = this.path.Interp(Mathf.Clamp(num, 0f, 1f));
}
if (this.tweenArguments.Contains("orienttopath") && ((bool) this.tweenArguments["orienttopath"]))
{
float lookAhead;
if (this.tweenArguments.Contains("lookahead"))
{
lookAhead = (float) this.tweenArguments["lookahead"];
}
else
{
lookAhead = Defaults.lookAhead;
}
float num3 = this.ease(0f, 1f, Mathf.Min((float) 1f, (float) (this.percentage + lookAhead)));
this.tweenArguments["looktarget"] = this.path.Interp(Mathf.Clamp(num3, 0f, 1f));
}
this.postUpdate = base.transform.position;
if (this.physics)
{
base.transform.position = this.preUpdate;
base.rigidbody.MovePosition(this.postUpdate);
}
}
private void ApplyMoveToTargets()
{
this.preUpdate = base.transform.position;
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
if (this.isLocal)
{
base.transform.localPosition = this.vector3s[2];
}
else
{
base.transform.position = this.vector3s[2];
}
if (this.percentage == 1f)
{
if (this.isLocal)
{
base.transform.localPosition = this.vector3s[1];
}
else
{
base.transform.position = this.vector3s[1];
}
}
this.postUpdate = base.transform.position;
if (this.physics)
{
base.transform.position = this.preUpdate;
base.rigidbody.MovePosition(this.postUpdate);
}
}
private void ApplyPunchPositionTargets()
{
this.preUpdate = base.transform.position;
Vector3 eulerAngles = new Vector3();
if (this.tweenArguments.Contains("looktarget"))
{
eulerAngles = base.transform.eulerAngles;
base.transform.eulerAngles = this.vector3s[4];
}
if (this.vector3s[1].x > 0f)
{
this.vector3s[2].x = this.punch(this.vector3s[1].x, this.percentage);
}
else if (this.vector3s[1].x < 0f)
{
this.vector3s[2].x = -this.punch(Mathf.Abs(this.vector3s[1].x), this.percentage);
}
if (this.vector3s[1].y > 0f)
{
this.vector3s[2].y = this.punch(this.vector3s[1].y, this.percentage);
}
else if (this.vector3s[1].y < 0f)
{
this.vector3s[2].y = -this.punch(Mathf.Abs(this.vector3s[1].y), this.percentage);
}
if (this.vector3s[1].z > 0f)
{
this.vector3s[2].z = this.punch(this.vector3s[1].z, this.percentage);
}
else if (this.vector3s[1].z < 0f)
{
this.vector3s[2].z = -this.punch(Mathf.Abs(this.vector3s[1].z), this.percentage);
}
base.transform.Translate(this.vector3s[2] - this.vector3s[3], this.space);
this.vector3s[3] = this.vector3s[2];
if (this.tweenArguments.Contains("looktarget"))
{
base.transform.eulerAngles = eulerAngles;
}
this.postUpdate = base.transform.position;
if (this.physics)
{
base.transform.position = this.preUpdate;
base.rigidbody.MovePosition(this.postUpdate);
}
}
private void ApplyPunchRotationTargets()
{
this.preUpdate = base.transform.eulerAngles;
if (this.vector3s[1].x > 0f)
{
this.vector3s[2].x = this.punch(this.vector3s[1].x, this.percentage);
}
else if (this.vector3s[1].x < 0f)
{
this.vector3s[2].x = -this.punch(Mathf.Abs(this.vector3s[1].x), this.percentage);
}
if (this.vector3s[1].y > 0f)
{
this.vector3s[2].y = this.punch(this.vector3s[1].y, this.percentage);
}
else if (this.vector3s[1].y < 0f)
{
this.vector3s[2].y = -this.punch(Mathf.Abs(this.vector3s[1].y), this.percentage);
}
if (this.vector3s[1].z > 0f)
{
this.vector3s[2].z = this.punch(this.vector3s[1].z, this.percentage);
}
else if (this.vector3s[1].z < 0f)
{
this.vector3s[2].z = -this.punch(Mathf.Abs(this.vector3s[1].z), this.percentage);
}
base.transform.Rotate(this.vector3s[2] - this.vector3s[3], this.space);
this.vector3s[3] = this.vector3s[2];
this.postUpdate = base.transform.eulerAngles;
if (this.physics)
{
base.transform.eulerAngles = this.preUpdate;
base.rigidbody.MoveRotation(Quaternion.Euler(this.postUpdate));
}
}
private void ApplyPunchScaleTargets()
{
if (this.vector3s[1].x > 0f)
{
this.vector3s[2].x = this.punch(this.vector3s[1].x, this.percentage);
}
else if (this.vector3s[1].x < 0f)
{
this.vector3s[2].x = -this.punch(Mathf.Abs(this.vector3s[1].x), this.percentage);
}
if (this.vector3s[1].y > 0f)
{
this.vector3s[2].y = this.punch(this.vector3s[1].y, this.percentage);
}
else if (this.vector3s[1].y < 0f)
{
this.vector3s[2].y = -this.punch(Mathf.Abs(this.vector3s[1].y), this.percentage);
}
if (this.vector3s[1].z > 0f)
{
this.vector3s[2].z = this.punch(this.vector3s[1].z, this.percentage);
}
else if (this.vector3s[1].z < 0f)
{
this.vector3s[2].z = -this.punch(Mathf.Abs(this.vector3s[1].z), this.percentage);
}
base.transform.localScale = this.vector3s[0] + this.vector3s[2];
}
private void ApplyRectTargets()
{
this.rects[2].x = this.ease(this.rects[0].x, this.rects[1].x, this.percentage);
this.rects[2].y = this.ease(this.rects[0].y, this.rects[1].y, this.percentage);
this.rects[2].width = this.ease(this.rects[0].width, this.rects[1].width, this.percentage);
this.rects[2].height = this.ease(this.rects[0].height, this.rects[1].height, this.percentage);
this.tweenArguments["onupdateparams"] = this.rects[2];
if (this.percentage == 1f)
{
this.tweenArguments["onupdateparams"] = this.rects[1];
}
}
private void ApplyRotateAddTargets()
{
this.preUpdate = base.transform.eulerAngles;
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
base.transform.Rotate(this.vector3s[2] - this.vector3s[3], this.space);
this.vector3s[3] = this.vector3s[2];
this.postUpdate = base.transform.eulerAngles;
if (this.physics)
{
base.transform.eulerAngles = this.preUpdate;
base.rigidbody.MoveRotation(Quaternion.Euler(this.postUpdate));
}
}
private void ApplyRotateToTargets()
{
this.preUpdate = base.transform.eulerAngles;
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
if (this.isLocal)
{
base.transform.localRotation = Quaternion.Euler(this.vector3s[2]);
}
else
{
base.transform.rotation = Quaternion.Euler(this.vector3s[2]);
}
if (this.percentage == 1f)
{
if (this.isLocal)
{
base.transform.localRotation = Quaternion.Euler(this.vector3s[1]);
}
else
{
base.transform.rotation = Quaternion.Euler(this.vector3s[1]);
}
}
this.postUpdate = base.transform.eulerAngles;
if (this.physics)
{
base.transform.eulerAngles = this.preUpdate;
base.rigidbody.MoveRotation(Quaternion.Euler(this.postUpdate));
}
}
private void ApplyScaleToTargets()
{
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
base.transform.localScale = this.vector3s[2];
if (this.percentage == 1f)
{
base.transform.localScale = this.vector3s[1];
}
}
private void ApplyShakePositionTargets()
{
this.preUpdate = base.transform.position;
Vector3 eulerAngles = new Vector3();
if (this.tweenArguments.Contains("looktarget"))
{
eulerAngles = base.transform.eulerAngles;
base.transform.eulerAngles = this.vector3s[3];
}
if (this.percentage == 0f)
{
base.transform.Translate(this.vector3s[1], this.space);
}
base.transform.position = this.vector3s[0];
float num = 1f - this.percentage;
this.vector3s[2].x = UnityEngine.Random.Range((float) (-this.vector3s[1].x * num), (float) (this.vector3s[1].x * num));
this.vector3s[2].y = UnityEngine.Random.Range((float) (-this.vector3s[1].y * num), (float) (this.vector3s[1].y * num));
this.vector3s[2].z = UnityEngine.Random.Range((float) (-this.vector3s[1].z * num), (float) (this.vector3s[1].z * num));
base.transform.Translate(this.vector3s[2], this.space);
if (this.tweenArguments.Contains("looktarget"))
{
base.transform.eulerAngles = eulerAngles;
}
this.postUpdate = base.transform.position;
if (this.physics)
{
base.transform.position = this.preUpdate;
base.rigidbody.MovePosition(this.postUpdate);
}
}
private void ApplyShakeRotationTargets()
{
this.preUpdate = base.transform.eulerAngles;
if (this.percentage == 0f)
{
base.transform.Rotate(this.vector3s[1], this.space);
}
base.transform.eulerAngles = this.vector3s[0];
float num = 1f - this.percentage;
this.vector3s[2].x = UnityEngine.Random.Range((float) (-this.vector3s[1].x * num), (float) (this.vector3s[1].x * num));
this.vector3s[2].y = UnityEngine.Random.Range((float) (-this.vector3s[1].y * num), (float) (this.vector3s[1].y * num));
this.vector3s[2].z = UnityEngine.Random.Range((float) (-this.vector3s[1].z * num), (float) (this.vector3s[1].z * num));
base.transform.Rotate(this.vector3s[2], this.space);
this.postUpdate = base.transform.eulerAngles;
if (this.physics)
{
base.transform.eulerAngles = this.preUpdate;
base.rigidbody.MoveRotation(Quaternion.Euler(this.postUpdate));
}
}
private void ApplyShakeScaleTargets()
{
if (this.percentage == 0f)
{
base.transform.localScale = this.vector3s[1];
}
base.transform.localScale = this.vector3s[0];
float num = 1f - this.percentage;
this.vector3s[2].x = UnityEngine.Random.Range((float) (-this.vector3s[1].x * num), (float) (this.vector3s[1].x * num));
this.vector3s[2].y = UnityEngine.Random.Range((float) (-this.vector3s[1].y * num), (float) (this.vector3s[1].y * num));
this.vector3s[2].z = UnityEngine.Random.Range((float) (-this.vector3s[1].z * num), (float) (this.vector3s[1].z * num));
Transform transform = base.transform;
transform.localScale += this.vector3s[2];
}
private void ApplyStabTargets()
{
}
private void ApplyVector2Targets()
{
this.vector2s[2].x = this.ease(this.vector2s[0].x, this.vector2s[1].x, this.percentage);
this.vector2s[2].y = this.ease(this.vector2s[0].y, this.vector2s[1].y, this.percentage);
this.tweenArguments["onupdateparams"] = this.vector2s[2];
if (this.percentage == 1f)
{
this.tweenArguments["onupdateparams"] = this.vector2s[1];
}
}
private void ApplyVector3Targets()
{
this.vector3s[2].x = this.ease(this.vector3s[0].x, this.vector3s[1].x, this.percentage);
this.vector3s[2].y = this.ease(this.vector3s[0].y, this.vector3s[1].y, this.percentage);
this.vector3s[2].z = this.ease(this.vector3s[0].z, this.vector3s[1].z, this.percentage);
this.tweenArguments["onupdateparams"] = this.vector3s[2];
if (this.percentage == 1f)
{
this.tweenArguments["onupdateparams"] = this.vector3s[1];
}
}
public static void AudioFrom(GameObject target, Hashtable args)
{
Vector2 vector;
Vector2 vector2;
AudioSource audio;
args = CleanArgs(args);
if (args.Contains("audiosource"))
{
audio = (AudioSource) args["audiosource"];
}
else if (target.GetComponent(typeof(AudioSource)) != null)
{
audio = target.audio;
}
else
{
UnityEngine.Debug.LogError("iTween Error: AudioFrom requires an AudioSource.");
return;
}
vector.x = vector2.x = audio.volume;
vector.y = vector2.y = audio.pitch;
if (args.Contains("volume"))
{
vector2.x = (float) args["volume"];
}
if (args.Contains("pitch"))
{
vector2.y = (float) args["pitch"];
}
audio.volume = vector2.x;
audio.pitch = vector2.y;
args["volume"] = vector.x;
args["pitch"] = vector.y;
if (!args.Contains("easetype"))
{
args.Add("easetype", EaseType.linear);
}
args["type"] = "audio";
args["method"] = "to";
Launch(target, args);
}
public static void AudioFrom(GameObject target, float volume, float pitch, float time)
{
object[] args = new object[] { "volume", volume, "pitch", pitch, "time", time };
AudioFrom(target, Hash(args));
}
public static void AudioTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if (!args.Contains("easetype"))
{
args.Add("easetype", EaseType.linear);
}
args["type"] = "audio";
args["method"] = "to";
Launch(target, args);
}
public static void AudioTo(GameObject target, float volume, float pitch, float time)
{
object[] args = new object[] { "volume", volume, "pitch", pitch, "time", time };
AudioTo(target, Hash(args));
}
public static void AudioUpdate(GameObject target, Hashtable args)
{
AudioSource audio;
float updateTime;
CleanArgs(args);
Vector2[] vectorArray = new Vector2[4];
if (args.Contains("time"))
{
updateTime = (float) args["time"];
updateTime *= Defaults.updateTimePercentage;
}
else
{
updateTime = Defaults.updateTime;
}
if (args.Contains("audiosource"))
{
audio = (AudioSource) args["audiosource"];
}
else if (target.GetComponent(typeof(AudioSource)) != null)
{
audio = target.audio;
}
else
{
UnityEngine.Debug.LogError("iTween Error: AudioUpdate requires an AudioSource.");
return;
}
vectorArray[0] = vectorArray[1] = new Vector2(audio.volume, audio.pitch);
if (args.Contains("volume"))
{
vectorArray[1].x = (float) args["volume"];
}
if (args.Contains("pitch"))
{
vectorArray[1].y = (float) args["pitch"];
}
vectorArray[3].x = Mathf.SmoothDampAngle(vectorArray[0].x, vectorArray[1].x, ref vectorArray[2].x, updateTime);
vectorArray[3].y = Mathf.SmoothDampAngle(vectorArray[0].y, vectorArray[1].y, ref vectorArray[2].y, updateTime);
audio.volume = vectorArray[3].x;
audio.pitch = vectorArray[3].y;
}
public static void AudioUpdate(GameObject target, float volume, float pitch, float time)
{
object[] args = new object[] { "volume", volume, "pitch", pitch, "time", time };
AudioUpdate(target, Hash(args));
}
private void Awake()
{
this.RetrieveArgs();
this.lastRealTime = Time.realtimeSinceStartup;
}
private void CallBack(string callbackType)
{
if (this.tweenArguments.Contains(callbackType) && !this.tweenArguments.Contains("ischild"))
{
GameObject gameObject;
if (this.tweenArguments.Contains(callbackType + "target"))
{
gameObject = (GameObject) this.tweenArguments[callbackType + "target"];
}
else
{
gameObject = base.gameObject;
}
if (this.tweenArguments[callbackType].GetType() == typeof(string))
{
gameObject.SendMessage((string) this.tweenArguments[callbackType], this.tweenArguments[callbackType + "params"], SendMessageOptions.DontRequireReceiver);
}
else
{
UnityEngine.Debug.LogError("iTween Error: Callback method references must be passed as a String!");
UnityEngine.Object.Destroy(this);
}
}
}
public static GameObject CameraFadeAdd()
{
if (cameraFade != null)
{
return null;
}
cameraFade = new GameObject("iTween Camera Fade");
cameraFade.transform.position = new Vector3(0.5f, 0.5f, (float) Defaults.cameraFadeDepth);
cameraFade.AddComponent("GUITexture");
cameraFade.guiTexture.texture = CameraTexture(Color.black);
cameraFade.guiTexture.color = new Color(0.5f, 0.5f, 0.5f, 0f);
return cameraFade;
}
public static GameObject CameraFadeAdd(Texture2D texture)
{
if (cameraFade != null)
{
return null;
}
cameraFade = new GameObject("iTween Camera Fade");
cameraFade.transform.position = new Vector3(0.5f, 0.5f, (float) Defaults.cameraFadeDepth);
cameraFade.AddComponent("GUITexture");
cameraFade.guiTexture.texture = texture;
cameraFade.guiTexture.color = new Color(0.5f, 0.5f, 0.5f, 0f);
return cameraFade;
}
public static GameObject CameraFadeAdd(Texture2D texture, int depth)
{
if (cameraFade != null)
{
return null;
}
cameraFade = new GameObject("iTween Camera Fade");
cameraFade.transform.position = new Vector3(0.5f, 0.5f, (float) depth);
cameraFade.AddComponent("GUITexture");
cameraFade.guiTexture.texture = texture;
cameraFade.guiTexture.color = new Color(0.5f, 0.5f, 0.5f, 0f);
return cameraFade;
}
public static void CameraFadeDepth(int depth)
{
if (cameraFade != null)
{
cameraFade.transform.position = new Vector3(cameraFade.transform.position.x, cameraFade.transform.position.y, (float) depth);
}
}
public static void CameraFadeDestroy()
{
if (cameraFade != null)
{
UnityEngine.Object.Destroy(cameraFade);
}
}
public static void CameraFadeFrom(Hashtable args)
{
if (cameraFade != null)
{
ColorFrom(cameraFade, args);
}
else
{
UnityEngine.Debug.LogError("iTween Error: You must first add a camera fade object with CameraFadeAdd() before atttempting to use camera fading.");
}
}
public static void CameraFadeFrom(float amount, float time)
{
if (cameraFade != null)
{
object[] args = new object[] { "amount", amount, "time", time };
CameraFadeFrom(Hash(args));
}
else
{
UnityEngine.Debug.LogError("iTween Error: You must first add a camera fade object with CameraFadeAdd() before atttempting to use camera fading.");
}
}
public static void CameraFadeSwap(Texture2D texture)
{
if (cameraFade != null)
{
cameraFade.guiTexture.texture = texture;
}
}
public static void CameraFadeTo(Hashtable args)
{
if (cameraFade != null)
{
ColorTo(cameraFade, args);
}
else
{
UnityEngine.Debug.LogError("iTween Error: You must first add a camera fade object with CameraFadeAdd() before atttempting to use camera fading.");
}
}
public static void CameraFadeTo(float amount, float time)
{
if (cameraFade != null)
{
object[] args = new object[] { "amount", amount, "time", time };
CameraFadeTo(Hash(args));
}
else
{
UnityEngine.Debug.LogError("iTween Error: You must first add a camera fade object with CameraFadeAdd() before atttempting to use camera fading.");
}
}
public static Texture2D CameraTexture(Color color)
{
Texture2D textured = new Texture2D(Screen.width, Screen.height, TextureFormat.ARGB32, false);
Color[] colors = new Color[Screen.width * Screen.height];
for (int i = 0; i < colors.Length; i++)
{
colors[i] = color;
}
textured.SetPixels(colors);
textured.Apply();
return textured;
}
private static Hashtable CleanArgs(Hashtable args)
{
Hashtable hashtable = new Hashtable(args.Count);
Hashtable hashtable2 = new Hashtable(args.Count);
IDictionaryEnumerator enumerator = args.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
DictionaryEntry current = (DictionaryEntry) enumerator.Current;
hashtable.Add(current.Key, current.Value);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
IDictionaryEnumerator enumerator2 = hashtable.GetEnumerator();
try
{
while (enumerator2.MoveNext())
{
DictionaryEntry entry2 = (DictionaryEntry) enumerator2.Current;
if (entry2.Value.GetType() == typeof(int))
{
int num = (int) entry2.Value;
float num2 = num;
args[entry2.Key] = num2;
}
if (entry2.Value.GetType() == typeof(double))
{
double num3 = (double) entry2.Value;
float num4 = (float) num3;
args[entry2.Key] = num4;
}
}
}
finally
{
IDisposable disposable2 = enumerator2 as IDisposable;
if (disposable2 == null)
{
}
disposable2.Dispose();
}
IDictionaryEnumerator enumerator3 = args.GetEnumerator();
try
{
while (enumerator3.MoveNext())
{
DictionaryEntry entry3 = (DictionaryEntry) enumerator3.Current;
string key = entry3.Key.ToString().ToLower();
hashtable2.Add(key, entry3.Value);
}
}
finally
{
IDisposable disposable3 = enumerator3 as IDisposable;
if (disposable3 == null)
{
}
disposable3.Dispose();
}
args = hashtable2;
return args;
}
private float clerp(float start, float end, float value)
{
float num = 0f;
float num2 = 360f;
float num3 = Mathf.Abs((float) ((num2 - num) / 2f));
float num5 = 0f;
if ((end - start) < -num3)
{
num5 = ((num2 - start) + end) * value;
return (start + num5);
}
if ((end - start) > num3)
{
num5 = -((num2 - end) + start) * value;
return (start + num5);
}
return (start + ((end - start) * value));
}
public static void ColorFrom(GameObject target, Hashtable args)
{
Color color = new Color();
Color color2 = new Color();
args = CleanArgs(args);
if (!args.Contains("includechildren") || ((bool) args["includechildren"]))
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Hashtable hashtable = (Hashtable) args.Clone();
hashtable["ischild"] = true;
ColorFrom(current.gameObject, hashtable);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
if (!args.Contains("easetype"))
{
args.Add("easetype", EaseType.linear);
}
if (target.GetComponent(typeof(GUITexture)) != null)
{
color2 = color = target.guiTexture.color;
}
else if (target.GetComponent(typeof(GUIText)) != null)
{
color2 = color = target.guiText.material.color;
}
else if (target.renderer != null)
{
color2 = color = target.renderer.material.color;
}
else if (target.light != null)
{
color2 = color = target.light.color;
}
if (args.Contains("color"))
{
color = (Color) args["color"];
}
else
{
if (args.Contains("r"))
{
color.r = (float) args["r"];
}
if (args.Contains("g"))
{
color.g = (float) args["g"];
}
if (args.Contains("b"))
{
color.b = (float) args["b"];
}
if (args.Contains("a"))
{
color.a = (float) args["a"];
}
}
if (args.Contains("amount"))
{
color.a = (float) args["amount"];
args.Remove("amount");
}
else if (args.Contains("alpha"))
{
color.a = (float) args["alpha"];
args.Remove("alpha");
}
if (target.GetComponent(typeof(GUITexture)) != null)
{
target.guiTexture.color = color;
}
else if (target.GetComponent(typeof(GUIText)) != null)
{
target.guiText.material.color = color;
}
else if (target.renderer != null)
{
target.renderer.material.color = color;
}
else if (target.light != null)
{
target.light.color = color;
}
args["color"] = color2;
args["type"] = "color";
args["method"] = "to";
Launch(target, args);
}
public static void ColorFrom(GameObject target, Color color, float time)
{
object[] args = new object[] { "color", color, "time", time };
ColorFrom(target, Hash(args));
}
public static void ColorTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if (!args.Contains("includechildren") || ((bool) args["includechildren"]))
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Hashtable hashtable = (Hashtable) args.Clone();
hashtable["ischild"] = true;
ColorTo(current.gameObject, hashtable);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
if (!args.Contains("easetype"))
{
args.Add("easetype", EaseType.linear);
}
args["type"] = "color";
args["method"] = "to";
Launch(target, args);
}
public static void ColorTo(GameObject target, Color color, float time)
{
object[] args = new object[] { "color", color, "time", time };
ColorTo(target, Hash(args));
}
public static void ColorUpdate(GameObject target, Hashtable args)
{
float updateTime;
CleanArgs(args);
Color[] colorArray = new Color[4];
if (!args.Contains("includechildren") || ((bool) args["includechildren"]))
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
ColorUpdate(current.gameObject, args);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
if (args.Contains("time"))
{
updateTime = (float) args["time"];
updateTime *= Defaults.updateTimePercentage;
}
else
{
updateTime = Defaults.updateTime;
}
if (target.GetComponent(typeof(GUITexture)) != null)
{
colorArray[0] = colorArray[1] = target.guiTexture.color;
}
else if (target.GetComponent(typeof(GUIText)) != null)
{
colorArray[0] = colorArray[1] = target.guiText.material.color;
}
else if (target.renderer != null)
{
colorArray[0] = colorArray[1] = target.renderer.material.color;
}
else if (target.light != null)
{
colorArray[0] = colorArray[1] = target.light.color;
}
if (args.Contains("color"))
{
colorArray[1] = (Color) args["color"];
}
else
{
if (args.Contains("r"))
{
colorArray[1].r = (float) args["r"];
}
if (args.Contains("g"))
{
colorArray[1].g = (float) args["g"];
}
if (args.Contains("b"))
{
colorArray[1].b = (float) args["b"];
}
if (args.Contains("a"))
{
colorArray[1].a = (float) args["a"];
}
}
colorArray[3].r = Mathf.SmoothDamp(colorArray[0].r, colorArray[1].r, ref colorArray[2].r, updateTime);
colorArray[3].g = Mathf.SmoothDamp(colorArray[0].g, colorArray[1].g, ref colorArray[2].g, updateTime);
colorArray[3].b = Mathf.SmoothDamp(colorArray[0].b, colorArray[1].b, ref colorArray[2].b, updateTime);
colorArray[3].a = Mathf.SmoothDamp(colorArray[0].a, colorArray[1].a, ref colorArray[2].a, updateTime);
if (target.GetComponent(typeof(GUITexture)) != null)
{
target.guiTexture.color = colorArray[3];
}
else if (target.GetComponent(typeof(GUIText)) != null)
{
target.guiText.material.color = colorArray[3];
}
else if (target.renderer != null)
{
target.renderer.material.color = colorArray[3];
}
else if (target.light != null)
{
target.light.color = colorArray[3];
}
}
public static void ColorUpdate(GameObject target, Color color, float time)
{
object[] args = new object[] { "color", color, "time", time };
ColorUpdate(target, Hash(args));
}
private void ConflictCheck()
{
foreach (iTween tween in base.GetComponents(typeof(iTween)))
{
if (tween.type == "value")
{
return;
}
if (tween.isRunning && (tween.type == this.type))
{
if (tween.method != this.method)
{
return;
}
if (tween.tweenArguments.Count != this.tweenArguments.Count)
{
tween.Dispose();
return;
}
IDictionaryEnumerator enumerator = this.tweenArguments.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
DictionaryEntry current = (DictionaryEntry) enumerator.Current;
if (!tween.tweenArguments.Contains(current.Key))
{
tween.Dispose();
break;
}
if (!tween.tweenArguments[current.Key].Equals(this.tweenArguments[current.Key]) && (((string) current.Key) != "id"))
{
tween.Dispose();
break;
}
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
this.Dispose();
}
}
}
public static int Count()
{
return tweens.Count;
}
public static int Count(string type)
{
int num = 0;
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
if ((((string) hashtable["type"]) + ((string) hashtable["method"])).Substring(0, type.Length).ToLower() == type.ToLower())
{
num++;
}
}
return num;
}
public static int Count(GameObject target)
{
return target.GetComponents(typeof(iTween)).Length;
}
public static int Count(GameObject target, string type)
{
int num = 0;
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
num++;
}
}
return num;
}
private void DisableKinematic()
{
}
private void Dispose()
{
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
if (((string) hashtable["id"]) == this.id)
{
tweens.RemoveAt(i);
break;
}
}
UnityEngine.Object.Destroy(this);
}
public static void DrawLine(Transform[] line)
{
if (line.Length > 0)
{
Vector3[] vectorArray = new Vector3[line.Length];
for (int i = 0; i < line.Length; i++)
{
vectorArray[i] = line[i].position;
}
DrawLineHelper(vectorArray, Defaults.color, "gizmos");
}
}
public static void DrawLine(Vector3[] line)
{
if (line.Length > 0)
{
DrawLineHelper(line, Defaults.color, "gizmos");
}
}
public static void DrawLine(Transform[] line, Color color)
{
if (line.Length > 0)
{
Vector3[] vectorArray = new Vector3[line.Length];
for (int i = 0; i < line.Length; i++)
{
vectorArray[i] = line[i].position;
}
DrawLineHelper(vectorArray, color, "gizmos");
}
}
public static void DrawLine(Vector3[] line, Color color)
{
if (line.Length > 0)
{
DrawLineHelper(line, color, "gizmos");
}
}
public static void DrawLineGizmos(Transform[] line)
{
if (line.Length > 0)
{
Vector3[] vectorArray = new Vector3[line.Length];
for (int i = 0; i < line.Length; i++)
{
vectorArray[i] = line[i].position;
}
DrawLineHelper(vectorArray, Defaults.color, "gizmos");
}
}
public static void DrawLineGizmos(Vector3[] line)
{
if (line.Length > 0)
{
DrawLineHelper(line, Defaults.color, "gizmos");
}
}
public static void DrawLineGizmos(Transform[] line, Color color)
{
if (line.Length > 0)
{
Vector3[] vectorArray = new Vector3[line.Length];
for (int i = 0; i < line.Length; i++)
{
vectorArray[i] = line[i].position;
}
DrawLineHelper(vectorArray, color, "gizmos");
}
}
public static void DrawLineGizmos(Vector3[] line, Color color)
{
if (line.Length > 0)
{
DrawLineHelper(line, color, "gizmos");
}
}
public static void DrawLineHandles(Transform[] line)
{
if (line.Length > 0)
{
Vector3[] vectorArray = new Vector3[line.Length];
for (int i = 0; i < line.Length; i++)
{
vectorArray[i] = line[i].position;
}
DrawLineHelper(vectorArray, Defaults.color, "handles");
}
}
public static void DrawLineHandles(Vector3[] line)
{
if (line.Length > 0)
{
DrawLineHelper(line, Defaults.color, "handles");
}
}
public static void DrawLineHandles(Transform[] line, Color color)
{
if (line.Length > 0)
{
Vector3[] vectorArray = new Vector3[line.Length];
for (int i = 0; i < line.Length; i++)
{
vectorArray[i] = line[i].position;
}
DrawLineHelper(vectorArray, color, "handles");
}
}
public static void DrawLineHandles(Vector3[] line, Color color)
{
if (line.Length > 0)
{
DrawLineHelper(line, color, "handles");
}
}
private static void DrawLineHelper(Vector3[] line, Color color, string method)
{
Gizmos.color = color;
for (int i = 0; i < (line.Length - 1); i++)
{
if (method == "gizmos")
{
Gizmos.DrawLine(line[i], line[i + 1]);
}
else if (method == "handles")
{
UnityEngine.Debug.LogError("iTween Error: Drawing a line with Handles is temporarily disabled because of compatability issues with Unity 2.6!");
}
}
}
public static void DrawPath(Transform[] path)
{
if (path.Length > 0)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
DrawPathHelper(vectorArray, Defaults.color, "gizmos");
}
}
public static void DrawPath(Vector3[] path)
{
if (path.Length > 0)
{
DrawPathHelper(path, Defaults.color, "gizmos");
}
}
public static void DrawPath(Transform[] path, Color color)
{
if (path.Length > 0)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
DrawPathHelper(vectorArray, color, "gizmos");
}
}
public static void DrawPath(Vector3[] path, Color color)
{
if (path.Length > 0)
{
DrawPathHelper(path, color, "gizmos");
}
}
public static void DrawPathGizmos(Transform[] path)
{
if (path.Length > 0)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
DrawPathHelper(vectorArray, Defaults.color, "gizmos");
}
}
public static void DrawPathGizmos(Vector3[] path)
{
if (path.Length > 0)
{
DrawPathHelper(path, Defaults.color, "gizmos");
}
}
public static void DrawPathGizmos(Transform[] path, Color color)
{
if (path.Length > 0)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
DrawPathHelper(vectorArray, color, "gizmos");
}
}
public static void DrawPathGizmos(Vector3[] path, Color color)
{
if (path.Length > 0)
{
DrawPathHelper(path, color, "gizmos");
}
}
public static void DrawPathHandles(Transform[] path)
{
if (path.Length > 0)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
DrawPathHelper(vectorArray, Defaults.color, "handles");
}
}
public static void DrawPathHandles(Vector3[] path)
{
if (path.Length > 0)
{
DrawPathHelper(path, Defaults.color, "handles");
}
}
public static void DrawPathHandles(Transform[] path, Color color)
{
if (path.Length > 0)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
DrawPathHelper(vectorArray, color, "handles");
}
}
public static void DrawPathHandles(Vector3[] path, Color color)
{
if (path.Length > 0)
{
DrawPathHelper(path, color, "handles");
}
}
private static void DrawPathHelper(Vector3[] path, Color color, string method)
{
Vector3[] pts = PathControlPointGenerator(path);
Vector3 to = Interp(pts, 0f);
Gizmos.color = color;
int num = path.Length * 20;
for (int i = 1; i <= num; i++)
{
float t = ((float) i) / ((float) num);
Vector3 from = Interp(pts, t);
if (method == "gizmos")
{
Gizmos.DrawLine(from, to);
}
else if (method == "handles")
{
UnityEngine.Debug.LogError("iTween Error: Drawing a path with Handles is temporarily disabled because of compatability issues with Unity 2.6!");
}
to = from;
}
}
private float easeInBack(float start, float end, float value)
{
end -= start;
value /= 1f;
float num = 1.70158f;
return ((((end * value) * value) * (((num + 1f) * value) - num)) + start);
}
private float easeInBounce(float start, float end, float value)
{
end -= start;
float num = 1f;
return ((end - this.easeOutBounce(0f, end, num - value)) + start);
}
private float easeInCirc(float start, float end, float value)
{
end -= start;
return ((-end * (Mathf.Sqrt(1f - (value * value)) - 1f)) + start);
}
private float easeInCubic(float start, float end, float value)
{
end -= start;
return ((((end * value) * value) * value) + start);
}
private float easeInElastic(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
float num4 = 0f;
if (value == 0f)
{
return start;
}
if ((value /= num) == 1f)
{
return (start + end);
}
if ((num4 == 0f) || (num4 < Mathf.Abs(end)))
{
num4 = end;
num3 = num2 / 4f;
}
else
{
num3 = (num2 / 6.283185f) * Mathf.Asin(end / num4);
}
return (-((num4 * Mathf.Pow(2f, 10f * --value)) * Mathf.Sin((((value * num) - num3) * 6.283185f) / num2)) + start);
}
private float easeInExpo(float start, float end, float value)
{
end -= start;
return ((end * Mathf.Pow(2f, 10f * ((value / 1f) - 1f))) + start);
}
private float easeInOutBack(float start, float end, float value)
{
float num = 1.70158f;
end -= start;
value /= 0.5f;
if (value < 1f)
{
num *= 1.525f;
return (((end / 2f) * ((value * value) * (((num + 1f) * value) - num))) + start);
}
value -= 2f;
num *= 1.525f;
return (((end / 2f) * (((value * value) * (((num + 1f) * value) + num)) + 2f)) + start);
}
private float easeInOutBounce(float start, float end, float value)
{
end -= start;
float num = 1f;
if (value < (num / 2f))
{
return ((this.easeInBounce(0f, end, value * 2f) * 0.5f) + start);
}
return (((this.easeOutBounce(0f, end, (value * 2f) - num) * 0.5f) + (end * 0.5f)) + start);
}
private float easeInOutCirc(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return (((-end / 2f) * (Mathf.Sqrt(1f - (value * value)) - 1f)) + start);
}
value -= 2f;
return (((end / 2f) * (Mathf.Sqrt(1f - (value * value)) + 1f)) + start);
}
private float easeInOutCubic(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return (((((end / 2f) * value) * value) * value) + start);
}
value -= 2f;
return (((end / 2f) * (((value * value) * value) + 2f)) + start);
}
private float easeInOutElastic(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
float num4 = 0f;
if (value == 0f)
{
return start;
}
if ((value /= (num / 2f)) == 2f)
{
return (start + end);
}
if ((num4 == 0f) || (num4 < Mathf.Abs(end)))
{
num4 = end;
num3 = num2 / 4f;
}
else
{
num3 = (num2 / 6.283185f) * Mathf.Asin(end / num4);
}
if (value < 1f)
{
return ((-0.5f * ((num4 * Mathf.Pow(2f, 10f * --value)) * Mathf.Sin((((value * num) - num3) * 6.283185f) / num2))) + start);
}
return (((((num4 * Mathf.Pow(2f, -10f * --value)) * Mathf.Sin((((value * num) - num3) * 6.283185f) / num2)) * 0.5f) + end) + start);
}
private float easeInOutExpo(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return (((end / 2f) * Mathf.Pow(2f, 10f * (value - 1f))) + start);
}
value--;
return (((end / 2f) * (-Mathf.Pow(2f, -10f * value) + 2f)) + start);
}
private float easeInOutQuad(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return ((((end / 2f) * value) * value) + start);
}
value--;
return (((-end / 2f) * ((value * (value - 2f)) - 1f)) + start);
}
private float easeInOutQuart(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return ((((((end / 2f) * value) * value) * value) * value) + start);
}
value -= 2f;
return (((-end / 2f) * ((((value * value) * value) * value) - 2f)) + start);
}
private float easeInOutQuint(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return (((((((end / 2f) * value) * value) * value) * value) * value) + start);
}
value -= 2f;
return (((end / 2f) * (((((value * value) * value) * value) * value) + 2f)) + start);
}
private float easeInOutSine(float start, float end, float value)
{
end -= start;
return (((-end / 2f) * (Mathf.Cos((3.141593f * value) / 1f) - 1f)) + start);
}
private float easeInQuad(float start, float end, float value)
{
end -= start;
return (((end * value) * value) + start);
}
private float easeInQuart(float start, float end, float value)
{
end -= start;
return (((((end * value) * value) * value) * value) + start);
}
private float easeInQuint(float start, float end, float value)
{
end -= start;
return ((((((end * value) * value) * value) * value) * value) + start);
}
private float easeInSine(float start, float end, float value)
{
end -= start;
return (((-end * Mathf.Cos((value / 1f) * 1.570796f)) + end) + start);
}
private float easeOutBack(float start, float end, float value)
{
float num = 1.70158f;
end -= start;
value = (value / 1f) - 1f;
return ((end * (((value * value) * (((num + 1f) * value) + num)) + 1f)) + start);
}
private float easeOutBounce(float start, float end, float value)
{
value /= 1f;
end -= start;
if (value < 0.3636364f)
{
return ((end * ((7.5625f * value) * value)) + start);
}
if (value < 0.7272727f)
{
value -= 0.5454546f;
return ((end * (((7.5625f * value) * value) + 0.75f)) + start);
}
if (value < 0.90909090909090906)
{
value -= 0.8181818f;
return ((end * (((7.5625f * value) * value) + 0.9375f)) + start);
}
value -= 0.9545454f;
return ((end * (((7.5625f * value) * value) + 0.984375f)) + start);
}
private float easeOutCirc(float start, float end, float value)
{
value--;
end -= start;
return ((end * Mathf.Sqrt(1f - (value * value))) + start);
}
private float easeOutCubic(float start, float end, float value)
{
value--;
end -= start;
return ((end * (((value * value) * value) + 1f)) + start);
}
private float easeOutElastic(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
float num4 = 0f;
if (value == 0f)
{
return start;
}
if ((value /= num) == 1f)
{
return (start + end);
}
if ((num4 == 0f) || (num4 < Mathf.Abs(end)))
{
num4 = end;
num3 = num2 / 4f;
}
else
{
num3 = (num2 / 6.283185f) * Mathf.Asin(end / num4);
}
return ((((num4 * Mathf.Pow(2f, -10f * value)) * Mathf.Sin((((value * num) - num3) * 6.283185f) / num2)) + end) + start);
}
private float easeOutExpo(float start, float end, float value)
{
end -= start;
return ((end * (-Mathf.Pow(2f, (-10f * value) / 1f) + 1f)) + start);
}
private float easeOutQuad(float start, float end, float value)
{
end -= start;
return (((-end * value) * (value - 2f)) + start);
}
private float easeOutQuart(float start, float end, float value)
{
value--;
end -= start;
return ((-end * ((((value * value) * value) * value) - 1f)) + start);
}
private float easeOutQuint(float start, float end, float value)
{
value--;
end -= start;
return ((end * (((((value * value) * value) * value) * value) + 1f)) + start);
}
private float easeOutSine(float start, float end, float value)
{
end -= start;
return ((end * Mathf.Sin((value / 1f) * 1.570796f)) + start);
}
private void EnableKinematic()
{
}
public static void FadeFrom(GameObject target, Hashtable args)
{
ColorFrom(target, args);
}
public static void FadeFrom(GameObject target, float alpha, float time)
{
object[] args = new object[] { "alpha", alpha, "time", time };
FadeFrom(target, Hash(args));
}
public static void FadeTo(GameObject target, Hashtable args)
{
ColorTo(target, args);
}
public static void FadeTo(GameObject target, float alpha, float time)
{
object[] args = new object[] { "alpha", alpha, "time", time };
FadeTo(target, Hash(args));
}
public static void FadeUpdate(GameObject target, Hashtable args)
{
args["a"] = args["alpha"];
ColorUpdate(target, args);
}
public static void FadeUpdate(GameObject target, float alpha, float time)
{
object[] args = new object[] { "alpha", alpha, "time", time };
FadeUpdate(target, Hash(args));
}
private void FixedUpdate()
{
if (this.isRunning && this.physics)
{
if (!this.reverse)
{
if (this.percentage < 1f)
{
this.TweenUpdate();
}
else
{
this.TweenComplete();
}
}
else if (this.percentage > 0f)
{
this.TweenUpdate();
}
else
{
this.TweenComplete();
}
}
}
public static float FloatUpdate(float currentValue, float targetValue, float speed)
{
float num = targetValue - currentValue;
currentValue += (num * speed) * Time.deltaTime;
return currentValue;
}
private void GenerateAudioToTargets()
{
this.vector2s = new Vector2[3];
if (this.tweenArguments.Contains("audiosource"))
{
this.audioSource = (AudioSource) this.tweenArguments["audiosource"];
}
else if (base.GetComponent(typeof(AudioSource)) != null)
{
this.audioSource = base.audio;
}
else
{
UnityEngine.Debug.LogError("iTween Error: AudioTo requires an AudioSource.");
this.Dispose();
}
this.vector2s[0] = this.vector2s[1] = new Vector2(this.audioSource.volume, this.audioSource.pitch);
if (this.tweenArguments.Contains("volume"))
{
this.vector2s[1].x = (float) this.tweenArguments["volume"];
}
if (this.tweenArguments.Contains("pitch"))
{
this.vector2s[1].y = (float) this.tweenArguments["pitch"];
}
}
private void GenerateColorTargets()
{
this.colors = new Color[1, 3];
this.colors[0, 0] = (Color) this.tweenArguments["from"];
this.colors[0, 1] = (Color) this.tweenArguments["to"];
}
private void GenerateColorToTargets()
{
if (base.GetComponent(typeof(GUITexture)) != null)
{
this.colors = new Color[1, 3];
this.colors[0, 0] = this.colors[0, 1] = base.guiTexture.color;
}
else if (base.GetComponent(typeof(GUIText)) != null)
{
this.colors = new Color[1, 3];
this.colors[0, 0] = this.colors[0, 1] = base.guiText.material.color;
}
else if (base.renderer != null)
{
this.colors = new Color[base.renderer.materials.Length, 3];
for (int i = 0; i < base.renderer.materials.Length; i++)
{
this.colors[i, 0] = base.renderer.materials[i].GetColor(this.namedcolorvalue.ToString());
this.colors[i, 1] = base.renderer.materials[i].GetColor(this.namedcolorvalue.ToString());
}
}
else if (base.light != null)
{
this.colors = new Color[1, 3];
this.colors[0, 0] = this.colors[0, 1] = base.light.color;
}
else
{
this.colors = new Color[1, 3];
}
if (this.tweenArguments.Contains("color"))
{
for (int j = 0; j < this.colors.GetLength(0); j++)
{
this.colors[j, 1] = (Color) this.tweenArguments["color"];
}
}
else
{
if (this.tweenArguments.Contains("r"))
{
for (int k = 0; k < this.colors.GetLength(0); k++)
{
this.colors[k, 1].r = (float) this.tweenArguments["r"];
}
}
if (this.tweenArguments.Contains("g"))
{
for (int m = 0; m < this.colors.GetLength(0); m++)
{
this.colors[m, 1].g = (float) this.tweenArguments["g"];
}
}
if (this.tweenArguments.Contains("b"))
{
for (int n = 0; n < this.colors.GetLength(0); n++)
{
this.colors[n, 1].b = (float) this.tweenArguments["b"];
}
}
if (this.tweenArguments.Contains("a"))
{
for (int num6 = 0; num6 < this.colors.GetLength(0); num6++)
{
this.colors[num6, 1].a = (float) this.tweenArguments["a"];
}
}
}
if (this.tweenArguments.Contains("amount"))
{
for (int num7 = 0; num7 < this.colors.GetLength(0); num7++)
{
this.colors[num7, 1].a = (float) this.tweenArguments["amount"];
}
}
else if (this.tweenArguments.Contains("alpha"))
{
for (int num8 = 0; num8 < this.colors.GetLength(0); num8++)
{
this.colors[num8, 1].a = (float) this.tweenArguments["alpha"];
}
}
}
private void GenerateFloatTargets()
{
this.floats = new float[3];
this.floats[0] = (float) this.tweenArguments["from"];
this.floats[1] = (float) this.tweenArguments["to"];
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs((float) (this.floats[0] - this.floats[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private static string GenerateID()
{
int num = 15;
char[] chArray = new char[] {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '\0'
};
int max = chArray.Length - 1;
string str = string.Empty;
for (int i = 0; i < num; i++)
{
str = str + chArray[(int) Mathf.Floor((float) UnityEngine.Random.Range(0, max))];
}
return str;
}
private void GenerateLookToTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = base.transform.eulerAngles;
if (this.tweenArguments.Contains("looktarget"))
{
if (this.tweenArguments["looktarget"].GetType() == typeof(Transform))
{
Vector3? nullable = (Vector3?) this.tweenArguments["up"];
base.transform.LookAt((Transform) this.tweenArguments["looktarget"], !nullable.HasValue ? Defaults.up : nullable.Value);
}
else if (this.tweenArguments["looktarget"].GetType() == typeof(Vector3))
{
Vector3? nullable2 = (Vector3?) this.tweenArguments["up"];
base.transform.LookAt((Vector3) this.tweenArguments["looktarget"], !nullable2.HasValue ? Defaults.up : nullable2.Value);
}
}
else
{
UnityEngine.Debug.LogError("iTween Error: LookTo needs a 'looktarget' property!");
this.Dispose();
}
this.vector3s[1] = base.transform.eulerAngles;
base.transform.eulerAngles = this.vector3s[0];
if (this.tweenArguments.Contains("axis"))
{
string key = (string) this.tweenArguments["axis"];
if (key != null)
{
int num2;
if (<>f__switch$map34 == null)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>(3);
dictionary.Add("x", 0);
dictionary.Add("y", 1);
dictionary.Add("z", 2);
<>f__switch$map34 = dictionary;
}
if (<>f__switch$map34.TryGetValue(key, out num2))
{
switch (num2)
{
case 0:
this.vector3s[1].y = this.vector3s[0].y;
this.vector3s[1].z = this.vector3s[0].z;
break;
case 1:
this.vector3s[1].x = this.vector3s[0].x;
this.vector3s[1].z = this.vector3s[0].z;
break;
case 2:
this.vector3s[1].x = this.vector3s[0].x;
this.vector3s[1].y = this.vector3s[0].y;
break;
}
}
}
}
this.vector3s[1] = new Vector3(this.clerp(this.vector3s[0].x, this.vector3s[1].x, 1f), this.clerp(this.vector3s[0].y, this.vector3s[1].y, 1f), this.clerp(this.vector3s[0].z, this.vector3s[1].z, 1f));
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateMoveByTargets()
{
Vector3 vector;
this.vector3s = new Vector3[6];
this.vector3s[4] = base.transform.eulerAngles;
this.vector3s[3] = vector = base.transform.position;
this.vector3s[0] = this.vector3s[1] = vector;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = this.vector3s[0] + ((Vector3) this.tweenArguments["amount"]);
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = this.vector3s[0].x + ((float) this.tweenArguments["x"]);
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = this.vector3s[0].y + ((float) this.tweenArguments["y"]);
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = this.vector3s[0].z + ((float) this.tweenArguments["z"]);
}
}
base.transform.Translate(this.vector3s[1], this.space);
this.vector3s[5] = base.transform.position;
base.transform.position = this.vector3s[0];
if (this.tweenArguments.Contains("orienttopath") && ((bool) this.tweenArguments["orienttopath"]))
{
this.tweenArguments["looktarget"] = this.vector3s[1];
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateMoveToPathTargets()
{
Vector3[] vectorArray;
bool flag;
int num2;
if (this.tweenArguments["path"].GetType() == typeof(Vector3[]))
{
Vector3[] sourceArray = (Vector3[]) this.tweenArguments["path"];
if (sourceArray.Length == 1)
{
UnityEngine.Debug.LogError("iTween Error: Attempting a path movement with MoveTo requires an array of more than 1 entry!");
this.Dispose();
}
vectorArray = new Vector3[sourceArray.Length];
Array.Copy(sourceArray, vectorArray, sourceArray.Length);
}
else
{
Transform[] transformArray = (Transform[]) this.tweenArguments["path"];
if (transformArray.Length == 1)
{
UnityEngine.Debug.LogError("iTween Error: Attempting a path movement with MoveTo requires an array of more than 1 entry!");
this.Dispose();
}
vectorArray = new Vector3[transformArray.Length];
for (int i = 0; i < transformArray.Length; i++)
{
vectorArray[i] = transformArray[i].position;
}
}
if (base.transform.position != vectorArray[0])
{
if (!this.tweenArguments.Contains("movetopath") || ((bool) this.tweenArguments["movetopath"]))
{
flag = true;
num2 = 3;
}
else
{
flag = false;
num2 = 2;
}
}
else
{
flag = false;
num2 = 2;
}
this.vector3s = new Vector3[vectorArray.Length + num2];
if (flag)
{
this.vector3s[1] = base.transform.position;
num2 = 2;
}
else
{
num2 = 1;
}
Array.Copy(vectorArray, 0, this.vector3s, num2, vectorArray.Length);
this.vector3s[0] = this.vector3s[1] + (this.vector3s[1] - this.vector3s[2]);
this.vector3s[this.vector3s.Length - 1] = this.vector3s[this.vector3s.Length - 2] + (this.vector3s[this.vector3s.Length - 2] - this.vector3s[this.vector3s.Length - 3]);
if (this.vector3s[1] == this.vector3s[this.vector3s.Length - 2])
{
Vector3[] destinationArray = new Vector3[this.vector3s.Length];
Array.Copy(this.vector3s, destinationArray, this.vector3s.Length);
destinationArray[0] = destinationArray[destinationArray.Length - 3];
destinationArray[destinationArray.Length - 1] = destinationArray[2];
this.vector3s = new Vector3[destinationArray.Length];
Array.Copy(destinationArray, this.vector3s, destinationArray.Length);
}
this.path = new CRSpline(this.vector3s);
if (this.tweenArguments.Contains("speed"))
{
float num3 = PathLength(this.vector3s);
this.time = num3 / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateMoveToTargets()
{
this.vector3s = new Vector3[3];
if (this.isLocal)
{
this.vector3s[0] = this.vector3s[1] = base.transform.localPosition;
}
else
{
this.vector3s[0] = this.vector3s[1] = base.transform.position;
}
if (this.tweenArguments.Contains("position"))
{
if (this.tweenArguments["position"].GetType() == typeof(Transform))
{
Transform transform = (Transform) this.tweenArguments["position"];
this.vector3s[1] = transform.position;
}
else if (this.tweenArguments["position"].GetType() == typeof(Vector3))
{
this.vector3s[1] = (Vector3) this.tweenArguments["position"];
}
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
if (this.tweenArguments.Contains("orienttopath") && ((bool) this.tweenArguments["orienttopath"]))
{
this.tweenArguments["looktarget"] = this.vector3s[1];
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GeneratePunchPositionTargets()
{
this.vector3s = new Vector3[5];
this.vector3s[4] = base.transform.eulerAngles;
this.vector3s[0] = base.transform.position;
this.vector3s[1] = this.vector3s[3] = Vector3.zero;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
}
private void GeneratePunchRotationTargets()
{
this.vector3s = new Vector3[4];
this.vector3s[0] = base.transform.eulerAngles;
this.vector3s[1] = this.vector3s[3] = Vector3.zero;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
}
private void GeneratePunchScaleTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = base.transform.localScale;
this.vector3s[1] = Vector3.zero;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
}
private void GenerateRectTargets()
{
this.rects = new Rect[3];
this.rects[0] = (Rect) this.tweenArguments["from"];
this.rects[1] = (Rect) this.tweenArguments["to"];
}
private void GenerateRotateAddTargets()
{
Vector3 vector;
this.vector3s = new Vector3[5];
this.vector3s[3] = vector = base.transform.eulerAngles;
this.vector3s[0] = this.vector3s[1] = vector;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] += (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x += (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y += (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z += (float) this.tweenArguments["z"];
}
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateRotateByTargets()
{
Vector3 vector;
this.vector3s = new Vector3[4];
this.vector3s[3] = vector = base.transform.eulerAngles;
this.vector3s[0] = this.vector3s[1] = vector;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] += Vector3.Scale((Vector3) this.tweenArguments["amount"], new Vector3(360f, 360f, 360f));
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x += 360f * ((float) this.tweenArguments["x"]);
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y += 360f * ((float) this.tweenArguments["y"]);
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z += 360f * ((float) this.tweenArguments["z"]);
}
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateRotateToTargets()
{
this.vector3s = new Vector3[3];
if (this.isLocal)
{
this.vector3s[0] = this.vector3s[1] = base.transform.localEulerAngles;
}
else
{
this.vector3s[0] = this.vector3s[1] = base.transform.eulerAngles;
}
if (this.tweenArguments.Contains("rotation"))
{
if (this.tweenArguments["rotation"].GetType() == typeof(Transform))
{
Transform transform = (Transform) this.tweenArguments["rotation"];
this.vector3s[1] = transform.eulerAngles;
}
else if (this.tweenArguments["rotation"].GetType() == typeof(Vector3))
{
this.vector3s[1] = (Vector3) this.tweenArguments["rotation"];
}
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
this.vector3s[1] = new Vector3(this.clerp(this.vector3s[0].x, this.vector3s[1].x, 1f), this.clerp(this.vector3s[0].y, this.vector3s[1].y, 1f), this.clerp(this.vector3s[0].z, this.vector3s[1].z, 1f));
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateScaleAddTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = this.vector3s[1] = base.transform.localScale;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] += (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x += (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y += (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z += (float) this.tweenArguments["z"];
}
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateScaleByTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = this.vector3s[1] = base.transform.localScale;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = Vector3.Scale(this.vector3s[1], (Vector3) this.tweenArguments["amount"]);
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x *= (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y *= (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z *= (float) this.tweenArguments["z"];
}
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateScaleToTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = this.vector3s[1] = base.transform.localScale;
if (this.tweenArguments.Contains("scale"))
{
if (this.tweenArguments["scale"].GetType() == typeof(Transform))
{
Transform transform = (Transform) this.tweenArguments["scale"];
this.vector3s[1] = transform.localScale;
}
else if (this.tweenArguments["scale"].GetType() == typeof(Vector3))
{
this.vector3s[1] = (Vector3) this.tweenArguments["scale"];
}
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateShakePositionTargets()
{
this.vector3s = new Vector3[4];
this.vector3s[3] = base.transform.eulerAngles;
this.vector3s[0] = base.transform.position;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
}
private void GenerateShakeRotationTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = base.transform.eulerAngles;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
}
private void GenerateShakeScaleTargets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = base.transform.localScale;
if (this.tweenArguments.Contains("amount"))
{
this.vector3s[1] = (Vector3) this.tweenArguments["amount"];
}
else
{
if (this.tweenArguments.Contains("x"))
{
this.vector3s[1].x = (float) this.tweenArguments["x"];
}
if (this.tweenArguments.Contains("y"))
{
this.vector3s[1].y = (float) this.tweenArguments["y"];
}
if (this.tweenArguments.Contains("z"))
{
this.vector3s[1].z = (float) this.tweenArguments["z"];
}
}
}
private void GenerateStabTargets()
{
if (this.tweenArguments.Contains("audiosource"))
{
this.audioSource = (AudioSource) this.tweenArguments["audiosource"];
}
else if (base.GetComponent(typeof(AudioSource)) != null)
{
this.audioSource = base.audio;
}
else
{
base.gameObject.AddComponent(typeof(AudioSource));
this.audioSource = base.audio;
this.audioSource.playOnAwake = false;
}
this.audioSource.clip = (AudioClip) this.tweenArguments["audioclip"];
if (this.tweenArguments.Contains("pitch"))
{
this.audioSource.pitch = (float) this.tweenArguments["pitch"];
}
if (this.tweenArguments.Contains("volume"))
{
this.audioSource.volume = (float) this.tweenArguments["volume"];
}
this.time = this.audioSource.clip.length / this.audioSource.pitch;
}
private void GenerateTargets()
{
string type = this.type;
if (type != null)
{
Dictionary<string, int> dictionary;
int num;
if (<>f__switch$map33 == null)
{
dictionary = new Dictionary<string, int>(10);
dictionary.Add("value", 0);
dictionary.Add("color", 1);
dictionary.Add("audio", 2);
dictionary.Add("move", 3);
dictionary.Add("scale", 4);
dictionary.Add("rotate", 5);
dictionary.Add("shake", 6);
dictionary.Add("punch", 7);
dictionary.Add("look", 8);
dictionary.Add("stab", 9);
<>f__switch$map33 = dictionary;
}
if (<>f__switch$map33.TryGetValue(type, out num))
{
string method;
int num2;
switch (num)
{
case 0:
method = this.method;
if (method != null)
{
if (<>f__switch$map2A == null)
{
dictionary = new Dictionary<string, int>(5);
dictionary.Add("float", 0);
dictionary.Add("vector2", 1);
dictionary.Add("vector3", 2);
dictionary.Add("color", 3);
dictionary.Add("rect", 4);
<>f__switch$map2A = dictionary;
}
if (<>f__switch$map2A.TryGetValue(method, out num2))
{
switch (num2)
{
case 0:
this.GenerateFloatTargets();
this.apply = new ApplyTween(this.ApplyFloatTargets);
return;
case 1:
this.GenerateVector2Targets();
this.apply = new ApplyTween(this.ApplyVector2Targets);
return;
case 2:
this.GenerateVector3Targets();
this.apply = new ApplyTween(this.ApplyVector3Targets);
return;
case 3:
this.GenerateColorTargets();
this.apply = new ApplyTween(this.ApplyColorTargets);
return;
case 4:
this.GenerateRectTargets();
this.apply = new ApplyTween(this.ApplyRectTargets);
return;
}
}
}
break;
case 1:
method = this.method;
if (method != null)
{
if (<>f__switch$map2B == null)
{
dictionary = new Dictionary<string, int>(1);
dictionary.Add("to", 0);
<>f__switch$map2B = dictionary;
}
if (<>f__switch$map2B.TryGetValue(method, out num2) && (num2 == 0))
{
this.GenerateColorToTargets();
this.apply = new ApplyTween(this.ApplyColorToTargets);
}
}
break;
case 2:
method = this.method;
if (method != null)
{
if (<>f__switch$map2C == null)
{
dictionary = new Dictionary<string, int>(1);
dictionary.Add("to", 0);
<>f__switch$map2C = dictionary;
}
if (<>f__switch$map2C.TryGetValue(method, out num2) && (num2 == 0))
{
this.GenerateAudioToTargets();
this.apply = new ApplyTween(this.ApplyAudioToTargets);
}
}
break;
case 3:
method = this.method;
if (method != null)
{
if (<>f__switch$map2D == null)
{
dictionary = new Dictionary<string, int>(3);
dictionary.Add("to", 0);
dictionary.Add("by", 1);
dictionary.Add("add", 1);
<>f__switch$map2D = dictionary;
}
if (<>f__switch$map2D.TryGetValue(method, out num2))
{
if (num2 == 0)
{
if (this.tweenArguments.Contains("path"))
{
this.GenerateMoveToPathTargets();
this.apply = new ApplyTween(this.ApplyMoveToPathTargets);
}
else
{
this.GenerateMoveToTargets();
this.apply = new ApplyTween(this.ApplyMoveToTargets);
}
}
else if (num2 == 1)
{
this.GenerateMoveByTargets();
this.apply = new ApplyTween(this.ApplyMoveByTargets);
break;
}
}
}
break;
case 4:
method = this.method;
if (method != null)
{
if (<>f__switch$map2E == null)
{
dictionary = new Dictionary<string, int>(3);
dictionary.Add("to", 0);
dictionary.Add("by", 1);
dictionary.Add("add", 2);
<>f__switch$map2E = dictionary;
}
if (<>f__switch$map2E.TryGetValue(method, out num2))
{
switch (num2)
{
case 0:
this.GenerateScaleToTargets();
this.apply = new ApplyTween(this.ApplyScaleToTargets);
return;
case 1:
this.GenerateScaleByTargets();
this.apply = new ApplyTween(this.ApplyScaleToTargets);
return;
case 2:
this.GenerateScaleAddTargets();
this.apply = new ApplyTween(this.ApplyScaleToTargets);
return;
}
}
}
break;
case 5:
method = this.method;
if (method != null)
{
if (<>f__switch$map2F == null)
{
dictionary = new Dictionary<string, int>(3);
dictionary.Add("to", 0);
dictionary.Add("add", 1);
dictionary.Add("by", 2);
<>f__switch$map2F = dictionary;
}
if (<>f__switch$map2F.TryGetValue(method, out num2))
{
switch (num2)
{
case 0:
this.GenerateRotateToTargets();
this.apply = new ApplyTween(this.ApplyRotateToTargets);
return;
case 1:
this.GenerateRotateAddTargets();
this.apply = new ApplyTween(this.ApplyRotateAddTargets);
return;
case 2:
this.GenerateRotateByTargets();
this.apply = new ApplyTween(this.ApplyRotateAddTargets);
return;
}
}
}
break;
case 6:
method = this.method;
if (method != null)
{
if (<>f__switch$map30 == null)
{
dictionary = new Dictionary<string, int>(3);
dictionary.Add("position", 0);
dictionary.Add("scale", 1);
dictionary.Add("rotation", 2);
<>f__switch$map30 = dictionary;
}
if (<>f__switch$map30.TryGetValue(method, out num2))
{
switch (num2)
{
case 0:
this.GenerateShakePositionTargets();
this.apply = new ApplyTween(this.ApplyShakePositionTargets);
return;
case 1:
this.GenerateShakeScaleTargets();
this.apply = new ApplyTween(this.ApplyShakeScaleTargets);
return;
case 2:
this.GenerateShakeRotationTargets();
this.apply = new ApplyTween(this.ApplyShakeRotationTargets);
return;
}
}
}
break;
case 7:
method = this.method;
if (method != null)
{
if (<>f__switch$map31 == null)
{
dictionary = new Dictionary<string, int>(3);
dictionary.Add("position", 0);
dictionary.Add("rotation", 1);
dictionary.Add("scale", 2);
<>f__switch$map31 = dictionary;
}
if (<>f__switch$map31.TryGetValue(method, out num2))
{
switch (num2)
{
case 0:
this.GeneratePunchPositionTargets();
this.apply = new ApplyTween(this.ApplyPunchPositionTargets);
return;
case 1:
this.GeneratePunchRotationTargets();
this.apply = new ApplyTween(this.ApplyPunchRotationTargets);
return;
case 2:
this.GeneratePunchScaleTargets();
this.apply = new ApplyTween(this.ApplyPunchScaleTargets);
return;
}
}
}
break;
case 8:
method = this.method;
if (method != null)
{
if (<>f__switch$map32 == null)
{
dictionary = new Dictionary<string, int>(1);
dictionary.Add("to", 0);
<>f__switch$map32 = dictionary;
}
if (<>f__switch$map32.TryGetValue(method, out num2) && (num2 == 0))
{
this.GenerateLookToTargets();
this.apply = new ApplyTween(this.ApplyLookToTargets);
}
}
break;
case 9:
this.GenerateStabTargets();
this.apply = new ApplyTween(this.ApplyStabTargets);
break;
}
}
}
}
private void GenerateVector2Targets()
{
this.vector2s = new Vector2[3];
this.vector2s[0] = (Vector2) this.tweenArguments["from"];
this.vector2s[1] = (Vector2) this.tweenArguments["to"];
if (this.tweenArguments.Contains("speed"))
{
Vector3 a = new Vector3(this.vector2s[0].x, this.vector2s[0].y, 0f);
Vector3 b = new Vector3(this.vector2s[1].x, this.vector2s[1].y, 0f);
float num = Math.Abs(Vector3.Distance(a, b));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GenerateVector3Targets()
{
this.vector3s = new Vector3[3];
this.vector3s[0] = (Vector3) this.tweenArguments["from"];
this.vector3s[1] = (Vector3) this.tweenArguments["to"];
if (this.tweenArguments.Contains("speed"))
{
float num = Math.Abs(Vector3.Distance(this.vector3s[0], this.vector3s[1]));
this.time = num / ((float) this.tweenArguments["speed"]);
}
}
private void GetEasingFunction()
{
switch (this.easeType)
{
case EaseType.easeInQuad:
this.ease = new EasingFunction(this.easeInQuad);
break;
case EaseType.easeOutQuad:
this.ease = new EasingFunction(this.easeOutQuad);
break;
case EaseType.easeInOutQuad:
this.ease = new EasingFunction(this.easeInOutQuad);
break;
case EaseType.easeInCubic:
this.ease = new EasingFunction(this.easeInCubic);
break;
case EaseType.easeOutCubic:
this.ease = new EasingFunction(this.easeOutCubic);
break;
case EaseType.easeInOutCubic:
this.ease = new EasingFunction(this.easeInOutCubic);
break;
case EaseType.easeInQuart:
this.ease = new EasingFunction(this.easeInQuart);
break;
case EaseType.easeOutQuart:
this.ease = new EasingFunction(this.easeOutQuart);
break;
case EaseType.easeInOutQuart:
this.ease = new EasingFunction(this.easeInOutQuart);
break;
case EaseType.easeInQuint:
this.ease = new EasingFunction(this.easeInQuint);
break;
case EaseType.easeOutQuint:
this.ease = new EasingFunction(this.easeOutQuint);
break;
case EaseType.easeInOutQuint:
this.ease = new EasingFunction(this.easeInOutQuint);
break;
case EaseType.easeInSine:
this.ease = new EasingFunction(this.easeInSine);
break;
case EaseType.easeOutSine:
this.ease = new EasingFunction(this.easeOutSine);
break;
case EaseType.easeInOutSine:
this.ease = new EasingFunction(this.easeInOutSine);
break;
case EaseType.easeInExpo:
this.ease = new EasingFunction(this.easeInExpo);
break;
case EaseType.easeOutExpo:
this.ease = new EasingFunction(this.easeOutExpo);
break;
case EaseType.easeInOutExpo:
this.ease = new EasingFunction(this.easeInOutExpo);
break;
case EaseType.easeInCirc:
this.ease = new EasingFunction(this.easeInCirc);
break;
case EaseType.easeOutCirc:
this.ease = new EasingFunction(this.easeOutCirc);
break;
case EaseType.easeInOutCirc:
this.ease = new EasingFunction(this.easeInOutCirc);
break;
case EaseType.linear:
this.ease = new EasingFunction(this.linear);
break;
case EaseType.spring:
this.ease = new EasingFunction(this.spring);
break;
case EaseType.easeInBounce:
this.ease = new EasingFunction(this.easeInBounce);
break;
case EaseType.easeOutBounce:
this.ease = new EasingFunction(this.easeOutBounce);
break;
case EaseType.easeInOutBounce:
this.ease = new EasingFunction(this.easeInOutBounce);
break;
case EaseType.easeInBack:
this.ease = new EasingFunction(this.easeInBack);
break;
case EaseType.easeOutBack:
this.ease = new EasingFunction(this.easeOutBack);
break;
case EaseType.easeInOutBack:
this.ease = new EasingFunction(this.easeInOutBack);
break;
case EaseType.easeInElastic:
this.ease = new EasingFunction(this.easeInElastic);
break;
case EaseType.easeOutElastic:
this.ease = new EasingFunction(this.easeOutElastic);
break;
case EaseType.easeInOutElastic:
this.ease = new EasingFunction(this.easeInOutElastic);
break;
}
}
public static Hashtable Hash(params object[] args)
{
Hashtable hashtable = new Hashtable(args.Length / 2);
if ((args.Length % 2) != 0)
{
UnityEngine.Debug.LogError("Tween Error: Hash requires an even number of arguments!");
return null;
}
for (int i = 0; i < (args.Length - 1); i += 2)
{
hashtable.Add(args[i], args[i + 1]);
}
return hashtable;
}
public static void Init(GameObject target)
{
MoveBy(target, Vector3.zero, 0f);
}
private static Vector3 Interp(Vector3[] pts, float t)
{
int num = pts.Length - 3;
int index = Mathf.Min(Mathf.FloorToInt(t * num), num - 1);
float num3 = (t * num) - index;
Vector3 vector = pts[index];
Vector3 vector2 = pts[index + 1];
Vector3 vector3 = pts[index + 2];
Vector3 vector4 = pts[index + 3];
return (Vector3) (0.5f * (((((((-vector + (3f * vector2)) - (3f * vector3)) + vector4) * ((num3 * num3) * num3)) + (((((2f * vector) - (5f * vector2)) + (4f * vector3)) - vector4) * (num3 * num3))) + ((-vector + vector3) * num3)) + (2f * vector2)));
}
private void LateUpdate()
{
if ((this.tweenArguments.Contains("looktarget") && this.isRunning) && (((this.type == "move") || (this.type == "shake")) || (this.type == "punch")))
{
LookUpdate(base.gameObject, this.tweenArguments);
}
}
private static void Launch(GameObject target, Hashtable args)
{
if (!args.Contains("id"))
{
args["id"] = GenerateID();
}
if (!args.Contains("target"))
{
args["target"] = target;
}
tweens.Insert(0, args);
target.AddComponent("iTween");
}
private float linear(float start, float end, float value)
{
return Mathf.Lerp(start, end, value);
}
public static void LookFrom(GameObject target, Hashtable args)
{
args = CleanArgs(args);
Vector3 eulerAngles = target.transform.eulerAngles;
if (args["looktarget"].GetType() == typeof(Transform))
{
Vector3? nullable = (Vector3?) args["up"];
target.transform.LookAt((Transform) args["looktarget"], !nullable.HasValue ? Defaults.up : nullable.Value);
}
else if (args["looktarget"].GetType() == typeof(Vector3))
{
Vector3? nullable2 = (Vector3?) args["up"];
target.transform.LookAt((Vector3) args["looktarget"], !nullable2.HasValue ? Defaults.up : nullable2.Value);
}
if (args.Contains("axis"))
{
Vector3 vector2 = target.transform.eulerAngles;
string key = (string) args["axis"];
if (key != null)
{
int num;
if (<>f__switch$map29 == null)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>(3);
dictionary.Add("x", 0);
dictionary.Add("y", 1);
dictionary.Add("z", 2);
<>f__switch$map29 = dictionary;
}
if (<>f__switch$map29.TryGetValue(key, out num))
{
switch (num)
{
case 0:
vector2.y = eulerAngles.y;
vector2.z = eulerAngles.z;
break;
case 1:
vector2.x = eulerAngles.x;
vector2.z = eulerAngles.z;
break;
case 2:
vector2.x = eulerAngles.x;
vector2.y = eulerAngles.y;
break;
}
}
}
target.transform.eulerAngles = vector2;
}
args["rotation"] = eulerAngles;
args["type"] = "rotate";
args["method"] = "to";
Launch(target, args);
}
public static void LookFrom(GameObject target, Vector3 looktarget, float time)
{
object[] args = new object[] { "looktarget", looktarget, "time", time };
LookFrom(target, Hash(args));
}
public static void LookTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if (args.Contains("looktarget") && (args["looktarget"].GetType() == typeof(Transform)))
{
Transform transform = (Transform) args["looktarget"];
args["position"] = new Vector3(transform.position.x, transform.position.y, transform.position.z);
args["rotation"] = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
}
args["type"] = "look";
args["method"] = "to";
Launch(target, args);
}
public static void LookTo(GameObject target, Vector3 looktarget, float time)
{
object[] args = new object[] { "looktarget", looktarget, "time", time };
LookTo(target, Hash(args));
}
public static void LookUpdate(GameObject target, Hashtable args)
{
float updateTime;
CleanArgs(args);
Vector3[] vectorArray = new Vector3[5];
if (args.Contains("looktime"))
{
updateTime = (float) args["looktime"];
updateTime *= Defaults.updateTimePercentage;
}
else if (args.Contains("time"))
{
updateTime = ((float) args["time"]) * 0.15f;
updateTime *= Defaults.updateTimePercentage;
}
else
{
updateTime = Defaults.updateTime;
}
vectorArray[0] = target.transform.eulerAngles;
if (args.Contains("looktarget"))
{
if (args["looktarget"].GetType() == typeof(Transform))
{
Vector3? nullable = (Vector3?) args["up"];
target.transform.LookAt((Transform) args["looktarget"], !nullable.HasValue ? Defaults.up : nullable.Value);
}
else if (args["looktarget"].GetType() == typeof(Vector3))
{
Vector3? nullable2 = (Vector3?) args["up"];
target.transform.LookAt((Vector3) args["looktarget"], !nullable2.HasValue ? Defaults.up : nullable2.Value);
}
}
else
{
UnityEngine.Debug.LogError("iTween Error: LookUpdate needs a 'looktarget' property!");
return;
}
vectorArray[1] = target.transform.eulerAngles;
target.transform.eulerAngles = vectorArray[0];
vectorArray[3].x = Mathf.SmoothDampAngle(vectorArray[0].x, vectorArray[1].x, ref vectorArray[2].x, updateTime);
vectorArray[3].y = Mathf.SmoothDampAngle(vectorArray[0].y, vectorArray[1].y, ref vectorArray[2].y, updateTime);
vectorArray[3].z = Mathf.SmoothDampAngle(vectorArray[0].z, vectorArray[1].z, ref vectorArray[2].z, updateTime);
target.transform.eulerAngles = vectorArray[3];
if (args.Contains("axis"))
{
vectorArray[4] = target.transform.eulerAngles;
string key = (string) args["axis"];
if (key != null)
{
int num2;
if (<>f__switch$map35 == null)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>(3);
dictionary.Add("x", 0);
dictionary.Add("y", 1);
dictionary.Add("z", 2);
<>f__switch$map35 = dictionary;
}
if (<>f__switch$map35.TryGetValue(key, out num2))
{
switch (num2)
{
case 0:
vectorArray[4].y = vectorArray[0].y;
vectorArray[4].z = vectorArray[0].z;
break;
case 1:
vectorArray[4].x = vectorArray[0].x;
vectorArray[4].z = vectorArray[0].z;
break;
case 2:
vectorArray[4].x = vectorArray[0].x;
vectorArray[4].y = vectorArray[0].y;
break;
}
}
}
target.transform.eulerAngles = vectorArray[4];
}
}
public static void LookUpdate(GameObject target, Vector3 looktarget, float time)
{
object[] args = new object[] { "looktarget", looktarget, "time", time };
LookUpdate(target, Hash(args));
}
public static void MoveAdd(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "move";
args["method"] = "add";
Launch(target, args);
}
public static void MoveAdd(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
MoveAdd(target, Hash(args));
}
public static void MoveBy(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "move";
args["method"] = "by";
Launch(target, args);
}
public static void MoveBy(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
MoveBy(target, Hash(args));
}
public static void MoveFrom(GameObject target, Hashtable args)
{
bool isLocal;
args = CleanArgs(args);
if (args.Contains("islocal"))
{
isLocal = (bool) args["islocal"];
}
else
{
isLocal = Defaults.isLocal;
}
if (args.Contains("path"))
{
Vector3[] vectorArray2;
if (args["path"].GetType() == typeof(Vector3[]))
{
Vector3[] sourceArray = (Vector3[]) args["path"];
vectorArray2 = new Vector3[sourceArray.Length];
Array.Copy(sourceArray, vectorArray2, sourceArray.Length);
}
else
{
Transform[] transformArray = (Transform[]) args["path"];
vectorArray2 = new Vector3[transformArray.Length];
for (int i = 0; i < transformArray.Length; i++)
{
vectorArray2[i] = transformArray[i].position;
}
}
if (vectorArray2[vectorArray2.Length - 1] != target.transform.position)
{
Vector3[] destinationArray = new Vector3[vectorArray2.Length + 1];
Array.Copy(vectorArray2, destinationArray, vectorArray2.Length);
if (isLocal)
{
destinationArray[destinationArray.Length - 1] = target.transform.localPosition;
target.transform.localPosition = destinationArray[0];
}
else
{
destinationArray[destinationArray.Length - 1] = target.transform.position;
target.transform.position = destinationArray[0];
}
args["path"] = destinationArray;
}
else
{
if (isLocal)
{
target.transform.localPosition = vectorArray2[0];
}
else
{
target.transform.position = vectorArray2[0];
}
args["path"] = vectorArray2;
}
}
else
{
Vector3 vector;
Vector3 position;
if (isLocal)
{
vector = position = target.transform.localPosition;
}
else
{
vector = position = target.transform.position;
}
if (args.Contains("position"))
{
if (args["position"].GetType() == typeof(Transform))
{
Transform transform = (Transform) args["position"];
position = transform.position;
}
else if (args["position"].GetType() == typeof(Vector3))
{
position = (Vector3) args["position"];
}
}
else
{
if (args.Contains("x"))
{
position.x = (float) args["x"];
}
if (args.Contains("y"))
{
position.y = (float) args["y"];
}
if (args.Contains("z"))
{
position.z = (float) args["z"];
}
}
if (isLocal)
{
target.transform.localPosition = position;
}
else
{
target.transform.position = position;
}
args["position"] = vector;
}
args["type"] = "move";
args["method"] = "to";
Launch(target, args);
}
public static void MoveFrom(GameObject target, Vector3 position, float time)
{
object[] args = new object[] { "position", position, "time", time };
MoveFrom(target, Hash(args));
}
public static void MoveTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if (args.Contains("position") && (args["position"].GetType() == typeof(Transform)))
{
Transform transform = (Transform) args["position"];
args["position"] = new Vector3(transform.position.x, transform.position.y, transform.position.z);
args["rotation"] = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
args["scale"] = new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z);
}
args["type"] = "move";
args["method"] = "to";
Launch(target, args);
}
public static void MoveTo(GameObject target, Vector3 position, float time)
{
object[] args = new object[] { "position", position, "time", time };
MoveTo(target, Hash(args));
}
public static void MoveUpdate(GameObject target, Hashtable args)
{
float updateTime;
bool isLocal;
CleanArgs(args);
Vector3[] vectorArray = new Vector3[4];
Vector3 position = target.transform.position;
if (args.Contains("time"))
{
updateTime = (float) args["time"];
updateTime *= Defaults.updateTimePercentage;
}
else
{
updateTime = Defaults.updateTime;
}
if (args.Contains("islocal"))
{
isLocal = (bool) args["islocal"];
}
else
{
isLocal = Defaults.isLocal;
}
if (isLocal)
{
vectorArray[0] = vectorArray[1] = target.transform.localPosition;
}
else
{
vectorArray[0] = vectorArray[1] = target.transform.position;
}
if (args.Contains("position"))
{
if (args["position"].GetType() == typeof(Transform))
{
Transform transform = (Transform) args["position"];
vectorArray[1] = transform.position;
}
else if (args["position"].GetType() == typeof(Vector3))
{
vectorArray[1] = (Vector3) args["position"];
}
}
else
{
if (args.Contains("x"))
{
vectorArray[1].x = (float) args["x"];
}
if (args.Contains("y"))
{
vectorArray[1].y = (float) args["y"];
}
if (args.Contains("z"))
{
vectorArray[1].z = (float) args["z"];
}
}
vectorArray[3].x = Mathf.SmoothDamp(vectorArray[0].x, vectorArray[1].x, ref vectorArray[2].x, updateTime);
vectorArray[3].y = Mathf.SmoothDamp(vectorArray[0].y, vectorArray[1].y, ref vectorArray[2].y, updateTime);
vectorArray[3].z = Mathf.SmoothDamp(vectorArray[0].z, vectorArray[1].z, ref vectorArray[2].z, updateTime);
if (args.Contains("orienttopath") && ((bool) args["orienttopath"]))
{
args["looktarget"] = vectorArray[3];
}
if (args.Contains("looktarget"))
{
LookUpdate(target, args);
}
if (isLocal)
{
target.transform.localPosition = vectorArray[3];
}
else
{
target.transform.position = vectorArray[3];
}
if (target.rigidbody != null)
{
Vector3 vector2 = target.transform.position;
target.transform.position = position;
target.rigidbody.MovePosition(vector2);
}
}
public static void MoveUpdate(GameObject target, Vector3 position, float time)
{
object[] args = new object[] { "position", position, "time", time };
MoveUpdate(target, Hash(args));
}
private void OnDisable()
{
this.DisableKinematic();
}
private void OnEnable()
{
if (this.isRunning)
{
this.EnableKinematic();
}
if (this.isPaused)
{
this.isPaused = false;
if (this.delay > 0f)
{
this.wasPaused = true;
this.ResumeDelay();
}
}
}
private static Vector3[] PathControlPointGenerator(Vector3[] path)
{
Vector3[] sourceArray = path;
int num = 2;
Vector3[] destinationArray = new Vector3[sourceArray.Length + num];
Array.Copy(sourceArray, 0, destinationArray, 1, sourceArray.Length);
destinationArray[0] = destinationArray[1] + (destinationArray[1] - destinationArray[2]);
destinationArray[destinationArray.Length - 1] = destinationArray[destinationArray.Length - 2] + (destinationArray[destinationArray.Length - 2] - destinationArray[destinationArray.Length - 3]);
if (destinationArray[1] == destinationArray[destinationArray.Length - 2])
{
Vector3[] vectorArray3 = new Vector3[destinationArray.Length];
Array.Copy(destinationArray, vectorArray3, destinationArray.Length);
vectorArray3[0] = vectorArray3[vectorArray3.Length - 3];
vectorArray3[vectorArray3.Length - 1] = vectorArray3[2];
destinationArray = new Vector3[vectorArray3.Length];
Array.Copy(vectorArray3, destinationArray, vectorArray3.Length);
}
return destinationArray;
}
public static float PathLength(Transform[] path)
{
Vector3[] vectorArray = new Vector3[path.Length];
float num = 0f;
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
Vector3[] pts = PathControlPointGenerator(vectorArray);
Vector3 a = Interp(pts, 0f);
int num3 = path.Length * 20;
for (int j = 1; j <= num3; j++)
{
float t = ((float) j) / ((float) num3);
Vector3 b = Interp(pts, t);
num += Vector3.Distance(a, b);
a = b;
}
return num;
}
public static float PathLength(Vector3[] path)
{
float num = 0f;
Vector3[] pts = PathControlPointGenerator(path);
Vector3 a = Interp(pts, 0f);
int num2 = path.Length * 20;
for (int i = 1; i <= num2; i++)
{
float t = ((float) i) / ((float) num2);
Vector3 b = Interp(pts, t);
num += Vector3.Distance(a, b);
a = b;
}
return num;
}
public static void Pause()
{
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject target = (GameObject) hashtable["target"];
Pause(target);
}
}
public static void Pause(string type)
{
ArrayList list = new ArrayList();
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject obj2 = (GameObject) hashtable["target"];
list.Insert(list.Count, obj2);
}
for (int j = 0; j < list.Count; j++)
{
Pause((GameObject) list[j], type);
}
}
public static void Pause(GameObject target)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if (tween.delay > 0f)
{
tween.delay -= Time.time - tween.delayStarted;
tween.StopCoroutine("TweenDelay");
}
tween.isPaused = true;
tween.enabled = false;
}
}
public static void Pause(GameObject target, bool includechildren)
{
Pause(target);
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Pause(current.gameObject, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
public static void Pause(GameObject target, string type)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
if (tween.delay > 0f)
{
tween.delay -= Time.time - tween.delayStarted;
tween.StopCoroutine("TweenDelay");
}
tween.isPaused = true;
tween.enabled = false;
}
}
}
public static void Pause(GameObject target, string type, bool includechildren)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
if (tween.delay > 0f)
{
tween.delay -= Time.time - tween.delayStarted;
tween.StopCoroutine("TweenDelay");
}
tween.isPaused = true;
tween.enabled = false;
}
}
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Pause(current.gameObject, type, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
public static Vector3 PointOnPath(Transform[] path, float percent)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
return Interp(PathControlPointGenerator(vectorArray), percent);
}
public static Vector3 PointOnPath(Vector3[] path, float percent)
{
return Interp(PathControlPointGenerator(path), percent);
}
private float punch(float amplitude, float value)
{
float num = 9f;
if (value == 0f)
{
return 0f;
}
if (value == 1f)
{
return 0f;
}
float num2 = 0.3f;
num = (num2 / 6.283185f) * Mathf.Asin(0f);
return ((amplitude * Mathf.Pow(2f, -10f * value)) * Mathf.Sin((((value * 1f) - num) * 6.283185f) / num2));
}
public static void PunchPosition(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "punch";
args["method"] = "position";
args["easetype"] = EaseType.punch;
Launch(target, args);
}
public static void PunchPosition(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
PunchPosition(target, Hash(args));
}
public static void PunchRotation(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "punch";
args["method"] = "rotation";
args["easetype"] = EaseType.punch;
Launch(target, args);
}
public static void PunchRotation(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
PunchRotation(target, Hash(args));
}
public static void PunchScale(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "punch";
args["method"] = "scale";
args["easetype"] = EaseType.punch;
Launch(target, args);
}
public static void PunchScale(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
PunchScale(target, Hash(args));
}
public static void PutOnPath(GameObject target, Transform[] path, float percent)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
target.transform.position = Interp(PathControlPointGenerator(vectorArray), percent);
}
public static void PutOnPath(GameObject target, Vector3[] path, float percent)
{
target.transform.position = Interp(PathControlPointGenerator(path), percent);
}
public static void PutOnPath(Transform target, Transform[] path, float percent)
{
Vector3[] vectorArray = new Vector3[path.Length];
for (int i = 0; i < path.Length; i++)
{
vectorArray[i] = path[i].position;
}
target.position = Interp(PathControlPointGenerator(vectorArray), percent);
}
public static void PutOnPath(Transform target, Vector3[] path, float percent)
{
target.position = Interp(PathControlPointGenerator(path), percent);
}
public static Rect RectUpdate(Rect currentValue, Rect targetValue, float speed)
{
return new Rect(FloatUpdate(currentValue.x, targetValue.x, speed), FloatUpdate(currentValue.y, targetValue.y, speed), FloatUpdate(currentValue.width, targetValue.width, speed), FloatUpdate(currentValue.height, targetValue.height, speed));
}
public static void Resume()
{
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject target = (GameObject) hashtable["target"];
Resume(target);
}
}
public static void Resume(string type)
{
ArrayList list = new ArrayList();
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject obj2 = (GameObject) hashtable["target"];
list.Insert(list.Count, obj2);
}
for (int j = 0; j < list.Count; j++)
{
Resume((GameObject) list[j], type);
}
}
public static void Resume(GameObject target)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
tween.enabled = true;
}
}
public static void Resume(GameObject target, bool includechildren)
{
Resume(target);
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Resume(current.gameObject, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
public static void Resume(GameObject target, string type)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
tween.enabled = true;
}
}
}
public static void Resume(GameObject target, string type, bool includechildren)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
tween.enabled = true;
}
}
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Resume(current.gameObject, type, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
private void ResumeDelay()
{
base.StartCoroutine("TweenDelay");
}
private void RetrieveArgs()
{
IEnumerator enumerator = tweens.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Hashtable current = (Hashtable) enumerator.Current;
if (((GameObject) current["target"]) == base.gameObject)
{
this.tweenArguments = current;
goto Label_006A;
}
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
Label_006A:
this.id = (string) this.tweenArguments["id"];
this.type = (string) this.tweenArguments["type"];
this._name = (string) this.tweenArguments["name"];
this.method = (string) this.tweenArguments["method"];
if (this.tweenArguments.Contains("time"))
{
this.time = (float) this.tweenArguments["time"];
}
else
{
this.time = Defaults.time;
}
if (base.rigidbody != null)
{
this.physics = true;
}
if (this.tweenArguments.Contains("delay"))
{
this.delay = (float) this.tweenArguments["delay"];
}
else
{
this.delay = Defaults.delay;
}
if (this.tweenArguments.Contains("namedcolorvalue"))
{
if (this.tweenArguments["namedcolorvalue"].GetType() == typeof(NamedValueColor))
{
this.namedcolorvalue = (NamedValueColor) ((int) this.tweenArguments["namedcolorvalue"]);
}
else
{
try
{
this.namedcolorvalue = (NamedValueColor) ((int) Enum.Parse(typeof(NamedValueColor), (string) this.tweenArguments["namedcolorvalue"], true));
}
catch
{
UnityEngine.Debug.LogWarning("iTween: Unsupported namedcolorvalue supplied! Default will be used.");
this.namedcolorvalue = NamedValueColor._Color;
}
}
}
else
{
this.namedcolorvalue = Defaults.namedColorValue;
}
if (this.tweenArguments.Contains("looptype"))
{
if (this.tweenArguments["looptype"].GetType() == typeof(LoopType))
{
this.loopType = (LoopType) ((int) this.tweenArguments["looptype"]);
}
else
{
try
{
this.loopType = (LoopType) ((int) Enum.Parse(typeof(LoopType), (string) this.tweenArguments["looptype"], true));
}
catch
{
UnityEngine.Debug.LogWarning("iTween: Unsupported loopType supplied! Default will be used.");
this.loopType = LoopType.none;
}
}
}
else
{
this.loopType = LoopType.none;
}
if (this.tweenArguments.Contains("easetype"))
{
if (this.tweenArguments["easetype"].GetType() == typeof(EaseType))
{
this.easeType = (EaseType) ((int) this.tweenArguments["easetype"]);
}
else
{
try
{
this.easeType = (EaseType) ((int) Enum.Parse(typeof(EaseType), (string) this.tweenArguments["easetype"], true));
}
catch
{
UnityEngine.Debug.LogWarning("iTween: Unsupported easeType supplied! Default will be used.");
this.easeType = Defaults.easeType;
}
}
}
else
{
this.easeType = Defaults.easeType;
}
if (this.tweenArguments.Contains("space"))
{
if (this.tweenArguments["space"].GetType() == typeof(Space))
{
this.space = (Space) ((int) this.tweenArguments["space"]);
}
else
{
try
{
this.space = (Space) ((int) Enum.Parse(typeof(Space), (string) this.tweenArguments["space"], true));
}
catch
{
UnityEngine.Debug.LogWarning("iTween: Unsupported space supplied! Default will be used.");
this.space = Defaults.space;
}
}
}
else
{
this.space = Defaults.space;
}
if (this.tweenArguments.Contains("islocal"))
{
this.isLocal = (bool) this.tweenArguments["islocal"];
}
else
{
this.isLocal = Defaults.isLocal;
}
if (this.tweenArguments.Contains("ignoretimescale"))
{
this.useRealTime = (bool) this.tweenArguments["ignoretimescale"];
}
else
{
this.useRealTime = Defaults.useRealTime;
}
this.GetEasingFunction();
}
public static void RotateAdd(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "rotate";
args["method"] = "add";
Launch(target, args);
}
public static void RotateAdd(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
RotateAdd(target, Hash(args));
}
public static void RotateBy(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "rotate";
args["method"] = "by";
Launch(target, args);
}
public static void RotateBy(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
RotateBy(target, Hash(args));
}
public static void RotateFrom(GameObject target, Hashtable args)
{
Vector3 vector;
Vector3 eulerAngles;
bool isLocal;
args = CleanArgs(args);
if (args.Contains("islocal"))
{
isLocal = (bool) args["islocal"];
}
else
{
isLocal = Defaults.isLocal;
}
if (isLocal)
{
vector = eulerAngles = target.transform.localEulerAngles;
}
else
{
vector = eulerAngles = target.transform.eulerAngles;
}
if (args.Contains("rotation"))
{
if (args["rotation"].GetType() == typeof(Transform))
{
Transform transform = (Transform) args["rotation"];
eulerAngles = transform.eulerAngles;
}
else if (args["rotation"].GetType() == typeof(Vector3))
{
eulerAngles = (Vector3) args["rotation"];
}
}
else
{
if (args.Contains("x"))
{
eulerAngles.x = (float) args["x"];
}
if (args.Contains("y"))
{
eulerAngles.y = (float) args["y"];
}
if (args.Contains("z"))
{
eulerAngles.z = (float) args["z"];
}
}
if (isLocal)
{
target.transform.localEulerAngles = eulerAngles;
}
else
{
target.transform.eulerAngles = eulerAngles;
}
args["rotation"] = vector;
args["type"] = "rotate";
args["method"] = "to";
Launch(target, args);
}
public static void RotateFrom(GameObject target, Vector3 rotation, float time)
{
object[] args = new object[] { "rotation", rotation, "time", time };
RotateFrom(target, Hash(args));
}
public static void RotateTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if (args.Contains("rotation") && (args["rotation"].GetType() == typeof(Transform)))
{
Transform transform = (Transform) args["rotation"];
args["position"] = new Vector3(transform.position.x, transform.position.y, transform.position.z);
args["rotation"] = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
args["scale"] = new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z);
}
args["type"] = "rotate";
args["method"] = "to";
Launch(target, args);
}
public static void RotateTo(GameObject target, Vector3 rotation, float time)
{
object[] args = new object[] { "rotation", rotation, "time", time };
RotateTo(target, Hash(args));
}
public static void RotateUpdate(GameObject target, Hashtable args)
{
bool isLocal;
float updateTime;
CleanArgs(args);
Vector3[] vectorArray = new Vector3[4];
Vector3 eulerAngles = target.transform.eulerAngles;
if (args.Contains("time"))
{
updateTime = (float) args["time"];
updateTime *= Defaults.updateTimePercentage;
}
else
{
updateTime = Defaults.updateTime;
}
if (args.Contains("islocal"))
{
isLocal = (bool) args["islocal"];
}
else
{
isLocal = Defaults.isLocal;
}
if (isLocal)
{
vectorArray[0] = target.transform.localEulerAngles;
}
else
{
vectorArray[0] = target.transform.eulerAngles;
}
if (args.Contains("rotation"))
{
if (args["rotation"].GetType() == typeof(Transform))
{
Transform transform = (Transform) args["rotation"];
vectorArray[1] = transform.eulerAngles;
}
else if (args["rotation"].GetType() == typeof(Vector3))
{
vectorArray[1] = (Vector3) args["rotation"];
}
}
vectorArray[3].x = Mathf.SmoothDampAngle(vectorArray[0].x, vectorArray[1].x, ref vectorArray[2].x, updateTime);
vectorArray[3].y = Mathf.SmoothDampAngle(vectorArray[0].y, vectorArray[1].y, ref vectorArray[2].y, updateTime);
vectorArray[3].z = Mathf.SmoothDampAngle(vectorArray[0].z, vectorArray[1].z, ref vectorArray[2].z, updateTime);
if (isLocal)
{
target.transform.localEulerAngles = vectorArray[3];
}
else
{
target.transform.eulerAngles = vectorArray[3];
}
if (target.rigidbody != null)
{
Vector3 euler = target.transform.eulerAngles;
target.transform.eulerAngles = eulerAngles;
target.rigidbody.MoveRotation(Quaternion.Euler(euler));
}
}
public static void RotateUpdate(GameObject target, Vector3 rotation, float time)
{
object[] args = new object[] { "rotation", rotation, "time", time };
RotateUpdate(target, Hash(args));
}
public static void ScaleAdd(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "scale";
args["method"] = "add";
Launch(target, args);
}
public static void ScaleAdd(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
ScaleAdd(target, Hash(args));
}
public static void ScaleBy(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "scale";
args["method"] = "by";
Launch(target, args);
}
public static void ScaleBy(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
ScaleBy(target, Hash(args));
}
public static void ScaleFrom(GameObject target, Hashtable args)
{
Vector3 localScale;
args = CleanArgs(args);
Vector3 vector = localScale = target.transform.localScale;
if (args.Contains("scale"))
{
if (args["scale"].GetType() == typeof(Transform))
{
Transform transform = (Transform) args["scale"];
localScale = transform.localScale;
}
else if (args["scale"].GetType() == typeof(Vector3))
{
localScale = (Vector3) args["scale"];
}
}
else
{
if (args.Contains("x"))
{
localScale.x = (float) args["x"];
}
if (args.Contains("y"))
{
localScale.y = (float) args["y"];
}
if (args.Contains("z"))
{
localScale.z = (float) args["z"];
}
}
target.transform.localScale = localScale;
args["scale"] = vector;
args["type"] = "scale";
args["method"] = "to";
Launch(target, args);
}
public static void ScaleFrom(GameObject target, Vector3 scale, float time)
{
object[] args = new object[] { "scale", scale, "time", time };
ScaleFrom(target, Hash(args));
}
public static void ScaleTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if (args.Contains("scale") && (args["scale"].GetType() == typeof(Transform)))
{
Transform transform = (Transform) args["scale"];
args["position"] = new Vector3(transform.position.x, transform.position.y, transform.position.z);
args["rotation"] = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
args["scale"] = new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z);
}
args["type"] = "scale";
args["method"] = "to";
Launch(target, args);
}
public static void ScaleTo(GameObject target, Vector3 scale, float time)
{
object[] args = new object[] { "scale", scale, "time", time };
ScaleTo(target, Hash(args));
}
public static void ScaleUpdate(GameObject target, Hashtable args)
{
float updateTime;
CleanArgs(args);
Vector3[] vectorArray = new Vector3[4];
if (args.Contains("time"))
{
updateTime = (float) args["time"];
updateTime *= Defaults.updateTimePercentage;
}
else
{
updateTime = Defaults.updateTime;
}
vectorArray[0] = vectorArray[1] = target.transform.localScale;
if (args.Contains("scale"))
{
if (args["scale"].GetType() == typeof(Transform))
{
Transform transform = (Transform) args["scale"];
vectorArray[1] = transform.localScale;
}
else if (args["scale"].GetType() == typeof(Vector3))
{
vectorArray[1] = (Vector3) args["scale"];
}
}
else
{
if (args.Contains("x"))
{
vectorArray[1].x = (float) args["x"];
}
if (args.Contains("y"))
{
vectorArray[1].y = (float) args["y"];
}
if (args.Contains("z"))
{
vectorArray[1].z = (float) args["z"];
}
}
vectorArray[3].x = Mathf.SmoothDamp(vectorArray[0].x, vectorArray[1].x, ref vectorArray[2].x, updateTime);
vectorArray[3].y = Mathf.SmoothDamp(vectorArray[0].y, vectorArray[1].y, ref vectorArray[2].y, updateTime);
vectorArray[3].z = Mathf.SmoothDamp(vectorArray[0].z, vectorArray[1].z, ref vectorArray[2].z, updateTime);
target.transform.localScale = vectorArray[3];
}
public static void ScaleUpdate(GameObject target, Vector3 scale, float time)
{
object[] args = new object[] { "scale", scale, "time", time };
ScaleUpdate(target, Hash(args));
}
public static void ShakePosition(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "shake";
args["method"] = "position";
Launch(target, args);
}
public static void ShakePosition(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
ShakePosition(target, Hash(args));
}
public static void ShakeRotation(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "shake";
args["method"] = "rotation";
Launch(target, args);
}
public static void ShakeRotation(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
ShakeRotation(target, Hash(args));
}
public static void ShakeScale(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "shake";
args["method"] = "scale";
Launch(target, args);
}
public static void ShakeScale(GameObject target, Vector3 amount, float time)
{
object[] args = new object[] { "amount", amount, "time", time };
ShakeScale(target, Hash(args));
}
private float spring(float start, float end, float value)
{
value = Mathf.Clamp01(value);
value = ((Mathf.Sin((value * 3.141593f) * (0.2f + (((2.5f * value) * value) * value))) * Mathf.Pow(1f - value, 2.2f)) + value) * (1f + (1.2f * (1f - value)));
return (start + ((end - start) * value));
}
public static void Stab(GameObject target, Hashtable args)
{
args = CleanArgs(args);
args["type"] = "stab";
Launch(target, args);
}
public static void Stab(GameObject target, AudioClip audioclip, float delay)
{
object[] args = new object[] { "audioclip", audioclip, "delay", delay };
Stab(target, Hash(args));
}
[DebuggerHidden]
private IEnumerator Start()
{
return new <Start>c__Iterator42 { <>f__this = this };
}
public static void Stop()
{
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject target = (GameObject) hashtable["target"];
Stop(target);
}
tweens.Clear();
}
public static void Stop(string type)
{
ArrayList list = new ArrayList();
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject obj2 = (GameObject) hashtable["target"];
list.Insert(list.Count, obj2);
}
for (int j = 0; j < list.Count; j++)
{
Stop((GameObject) list[j], type);
}
}
public static void Stop(GameObject target)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
tween.Dispose();
}
}
public static void Stop(GameObject target, bool includechildren)
{
Stop(target);
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Stop(current.gameObject, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
public static void Stop(GameObject target, string type)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
tween.Dispose();
}
}
}
public static void Stop(GameObject target, string type, bool includechildren)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if ((tween.type + tween.method).Substring(0, type.Length).ToLower() == type.ToLower())
{
tween.Dispose();
}
}
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
Stop(current.gameObject, type, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
public static void StopByName(string name)
{
ArrayList list = new ArrayList();
for (int i = 0; i < tweens.Count; i++)
{
Hashtable hashtable = (Hashtable) tweens[i];
GameObject obj2 = (GameObject) hashtable["target"];
list.Insert(list.Count, obj2);
}
for (int j = 0; j < list.Count; j++)
{
StopByName((GameObject) list[j], name);
}
}
public static void StopByName(GameObject target, string name)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if (tween._name == name)
{
tween.Dispose();
}
}
}
public static void StopByName(GameObject target, string name, bool includechildren)
{
foreach (iTween tween in target.GetComponents(typeof(iTween)))
{
if (tween._name == name)
{
tween.Dispose();
}
}
if (includechildren)
{
IEnumerator enumerator = target.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
StopByName(current.gameObject, name, true);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable == null)
{
}
disposable.Dispose();
}
}
}
private void TweenComplete()
{
this.isRunning = false;
if (this.percentage > 0.5f)
{
this.percentage = 1f;
}
else
{
this.percentage = 0f;
}
this.apply();
if (this.type == "value")
{
this.CallBack("onupdate");
}
if (this.loopType == LoopType.none)
{
this.Dispose();
}
else
{
this.TweenLoop();
}
this.CallBack("oncomplete");
}
[DebuggerHidden]
private IEnumerator TweenDelay()
{
return new <TweenDelay>c__Iterator40 { <>f__this = this };
}
private void TweenLoop()
{
this.DisableKinematic();
switch (this.loopType)
{
case LoopType.loop:
this.percentage = 0f;
this.runningTime = 0f;
this.apply();
base.StartCoroutine("TweenRestart");
break;
case LoopType.pingPong:
this.reverse = !this.reverse;
this.runningTime = 0f;
base.StartCoroutine("TweenRestart");
break;
}
}
[DebuggerHidden]
private IEnumerator TweenRestart()
{
return new <TweenRestart>c__Iterator41 { <>f__this = this };
}
private void TweenStart()
{
this.CallBack("onstart");
if (!this.loop)
{
this.ConflictCheck();
this.GenerateTargets();
}
if (this.type == "stab")
{
this.audioSource.PlayOneShot(this.audioSource.clip);
}
if ((((this.type == "move") || (this.type == "scale")) || ((this.type == "rotate") || (this.type == "punch"))) || (((this.type == "shake") || (this.type == "curve")) || (this.type == "look")))
{
this.EnableKinematic();
}
this.isRunning = true;
}
private void TweenUpdate()
{
this.apply();
this.CallBack("onupdate");
this.UpdatePercentage();
}
private void Update()
{
if (this.isRunning && !this.physics)
{
if (!this.reverse)
{
if (this.percentage < 1f)
{
this.TweenUpdate();
}
else
{
this.TweenComplete();
}
}
else if (this.percentage > 0f)
{
this.TweenUpdate();
}
else
{
this.TweenComplete();
}
}
}
private void UpdatePercentage()
{
if (this.useRealTime)
{
this.runningTime += Time.realtimeSinceStartup - this.lastRealTime;
}
else
{
this.runningTime += Time.deltaTime;
}
if (this.reverse)
{
this.percentage = 1f - (this.runningTime / this.time);
}
else
{
this.percentage = this.runningTime / this.time;
}
this.lastRealTime = Time.realtimeSinceStartup;
}
public static void ValueTo(GameObject target, Hashtable args)
{
args = CleanArgs(args);
if ((!args.Contains("onupdate") || !args.Contains("from")) || !args.Contains("to"))
{
UnityEngine.Debug.LogError("iTween Error: ValueTo() requires an 'onupdate' callback function and a 'from' and 'to' property. The supplied 'onupdate' callback must accept a single argument that is the same type as the supplied 'from' and 'to' properties!");
}
else
{
args["type"] = "value";
if (args["from"].GetType() == typeof(Vector2))
{
args["method"] = "vector2";
}
else if (args["from"].GetType() == typeof(Vector3))
{
args["method"] = "vector3";
}
else if (args["from"].GetType() == typeof(Rect))
{
args["method"] = "rect";
}
else if (args["from"].GetType() == typeof(float))
{
args["method"] = "float";
}
else if (args["from"].GetType() == typeof(Color))
{
args["method"] = "color";
}
else
{
UnityEngine.Debug.LogError("iTween Error: ValueTo() only works with interpolating Vector3s, Vector2s, floats, ints, Rects and Colors!");
return;
}
if (!args.Contains("easetype"))
{
args.Add("easetype", EaseType.linear);
}
Launch(target, args);
}
}
public static Vector2 Vector2Update(Vector2 currentValue, Vector2 targetValue, float speed)
{
Vector2 vector = targetValue - currentValue;
currentValue += (Vector2) ((vector * speed) * Time.deltaTime);
return currentValue;
}
public static Vector3 Vector3Update(Vector3 currentValue, Vector3 targetValue, float speed)
{
Vector3 vector = targetValue - currentValue;
currentValue += (Vector3) ((vector * speed) * Time.deltaTime);
return currentValue;
}
[CompilerGenerated]
private sealed class <Start>c__Iterator42 : IEnumerator, IDisposable, IEnumerator<object>
{
internal object $current;
internal int $PC;
internal iTween <>f__this;
[DebuggerHidden]
public void Dispose()
{
this.$PC = -1;
}
public bool MoveNext()
{
uint num = (uint) this.$PC;
this.$PC = -1;
switch (num)
{
case 0:
if (this.<>f__this.delay <= 0f)
{
break;
}
this.$current = this.<>f__this.StartCoroutine("TweenDelay");
this.$PC = 1;
return true;
case 1:
break;
default:
goto Label_006A;
}
this.<>f__this.TweenStart();
this.$PC = -1;
Label_006A:
return false;
}
[DebuggerHidden]
public void Reset()
{
throw new NotSupportedException();
}
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return this.$current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return this.$current;
}
}
}
[CompilerGenerated]
private sealed class <TweenDelay>c__Iterator40 : IEnumerator, IDisposable, IEnumerator<object>
{
internal object $current;
internal int $PC;
internal iTween <>f__this;
[DebuggerHidden]
public void Dispose()
{
this.$PC = -1;
}
public bool MoveNext()
{
uint num = (uint) this.$PC;
this.$PC = -1;
switch (num)
{
case 0:
this.<>f__this.delayStarted = Time.time;
this.$current = new WaitForSeconds(this.<>f__this.delay);
this.$PC = 1;
return true;
case 1:
if (this.<>f__this.wasPaused)
{
this.<>f__this.wasPaused = false;
this.<>f__this.TweenStart();
}
this.$PC = -1;
break;
}
return false;
}
[DebuggerHidden]
public void Reset()
{
throw new NotSupportedException();
}
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return this.$current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return this.$current;
}
}
}
[CompilerGenerated]
private sealed class <TweenRestart>c__Iterator41 : IEnumerator, IDisposable, IEnumerator<object>
{
internal object $current;
internal int $PC;
internal iTween <>f__this;
[DebuggerHidden]
public void Dispose()
{
this.$PC = -1;
}
public bool MoveNext()
{
uint num = (uint) this.$PC;
this.$PC = -1;
switch (num)
{
case 0:
if (this.<>f__this.delay <= 0f)
{
break;
}
this.<>f__this.delayStarted = Time.time;
this.$current = new WaitForSeconds(this.<>f__this.delay);
this.$PC = 1;
return true;
case 1:
break;
default:
goto Label_0086;
}
this.<>f__this.loop = true;
this.<>f__this.TweenStart();
this.$PC = -1;
Label_0086:
return false;
}
[DebuggerHidden]
public void Reset()
{
throw new NotSupportedException();
}
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return this.$current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return this.$current;
}
}
}
private delegate void ApplyTween();
private class CRSpline
{
public Vector3[] pts;
public CRSpline(params Vector3[] pts)
{
this.pts = new Vector3[pts.Length];
Array.Copy(pts, this.pts, pts.Length);
}
public Vector3 Interp(float t)
{
int num = this.pts.Length - 3;
int index = Mathf.Min(Mathf.FloorToInt(t * num), num - 1);
float num3 = (t * num) - index;
Vector3 vector = this.pts[index];
Vector3 vector2 = this.pts[index + 1];
Vector3 vector3 = this.pts[index + 2];
Vector3 vector4 = this.pts[index + 3];
return (Vector3) (0.5f * (((((((-vector + (3f * vector2)) - (3f * vector3)) + vector4) * ((num3 * num3) * num3)) + (((((2f * vector) - (5f * vector2)) + (4f * vector3)) - vector4) * (num3 * num3))) + ((-vector + vector3) * num3)) + (2f * vector2)));
}
}
public static class Defaults
{
public static int cameraFadeDepth = 0xf423f;
public static Color color = Color.white;
public static float delay = 0f;
public static iTween.EaseType easeType = iTween.EaseType.easeOutExpo;
public static bool isLocal = false;
public static float lookAhead = 0.05f;
public static float lookSpeed = 3f;
public static iTween.LoopType loopType = iTween.LoopType.none;
public static iTween.NamedValueColor namedColorValue = iTween.NamedValueColor._Color;
public static bool orientToPath = false;
public static Space space = Space.Self;
public static float time = 1f;
public static Vector3 up = Vector3.up;
public static float updateTime = (1f * updateTimePercentage);
public static float updateTimePercentage = 0.05f;
public static bool useRealTime = false;
}
public enum EaseType
{
easeInQuad,
easeOutQuad,
easeInOutQuad,
easeInCubic,
easeOutCubic,
easeInOutCubic,
easeInQuart,
easeOutQuart,
easeInOutQuart,
easeInQuint,
easeOutQuint,
easeInOutQuint,
easeInSine,
easeOutSine,
easeInOutSine,
easeInExpo,
easeOutExpo,
easeInOutExpo,
easeInCirc,
easeOutCirc,
easeInOutCirc,
linear,
spring,
easeInBounce,
easeOutBounce,
easeInOutBounce,
easeInBack,
easeOutBack,
easeInOutBack,
easeInElastic,
easeOutElastic,
easeInOutElastic,
punch
}
private delegate float EasingFunction(float start, float end, float value);
public enum LoopType
{
none,
loop,
pingPong
}
public enum NamedValueColor
{
_Color,
_SpecColor,
_Emission,
_ReflectColor
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wayfarer/rongYaoDaLuCode.git
git@gitee.com:wayfarer/rongYaoDaLuCode.git
wayfarer
rongYaoDaLuCode
rongYaoDaLuCode
master

搜索帮助