12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651 |
- //================================================================================
- //
- //================================================================================
- using UnityEngine;
- using System.Collections;
- //================================================================================
- //
- //================================================================================
- namespace ReaderRabbit
- {
- //================================================================================
- // Progress report.
- //================================================================================
- public enum ProgressType
- {
- None = 0,
- Unknown,
- Ok,
- Good,
- Wow,
- };
- //================================================================================
- // Videos played ingame.
- //================================================================================
- public enum VideoType
- {
- Introduction = 0,
- CloudNine,
- QueenCumulus,
- ArtGallery,
- Irvin,
- EndGame,
- Quantity,
- // The following two videos are not locked/unlocked because the player cannot play them in Options/Movies screen.
- GameTitle,
- CompanyLogo,
- GotoRaingearIsland,
- GotoEdgeOfCloudNine,
- };
- //================================================================================
- // DowntownCloudNine.
- //================================================================================
- public enum DCN_BackTypeEnum
- {
- // Queen Cumulus will speak different phrases based on the following player actions.
- DidNotVisitIslandFirstTimeOnly = 0,
- DidNotVisitIsland,
- AfterVisitingIslandFirstTimeOnly,
- AfterVisitingIsland,
- AfterVisitingIrvinsHouseFirstTimeOnly,
- AfterVisitingIrvinsHouse,
- };
- //================================================================================
- //
- //================================================================================
- public class PlayerData
- {
- //================================================================================
- // Singleton
- //================================================================================
- private static PlayerData s_Instance = null;
- public static PlayerData Instance()
- {
- if (s_Instance == null)
- s_Instance = new PlayerData();
- return s_Instance;
- }
-
- //================================================================================
- //
- //================================================================================
- const string PRACTICE_MODE_FILENAME = "_practice_mode_";
- private bool m_IsPracticeMode;
- private string m_PlayerName;
- private ItemState[] m_Items;
- private int m_SandwichCount;
- private int m_RedMarbleCount;
- private int m_OrangeMarbleCount;
- private int m_YellowMarbleCount;
- private int m_GreenMarbleCount;
- private int m_BlueMarbleCount;
- private int m_UsedRedMarbleCount;
- private int m_UsedOrangeMarbleCount;
- private int m_UsedYellowMarbleCount;
- private int m_UsedGreenMarbleCount;
- private int m_UsedBlueMarbleCount;
- private bool[] m_Visited;
- private Location m_CurrentLocation;
- private Location m_PreviousLocation;
- // Flags for blocked scenes.
- private bool[] m_BlockedLocation;
- private bool[] BlockedLocation =
- {
- true, //EdgeOfCloudNine,
- true, //CloudNineGateway,
- false, //CloudSpellingChallenge,
- false, //DowntownCloudNine,
- false, //CloudNineArtGallery,
- false, //AmazingArtGallery,
- true, //CloudSheepCrossing,
- false, //NewspaperCarrierScene,
- false, //RaingearIsland,
- false, //IrvinsHouse,
- false, //GumballScience,
- true, //RaingearThrowingMachine,
- false, //MusicalMarblePatterns,
- false, //RaingearForest,
- false, //RaingearForestMath,
- false, //SillySandwichShop,
- true, //RockHead,
- false, //FlowerpotPhonics,
- false, //RaingearRescue,
- };
- // Player levels.
- private int[] m_ActivityLevel;
- private bool[] m_IsActivityLocked;
- private bool[] m_IsActivityAutoLevel;
- private ProgressType[] m_ProgressLevel1;
- private ProgressType[] m_ProgressLevel2;
- private ProgressType[] m_ProgressLevel3;
- private int[] m_RaingearRescueProgressLevels;
- private int m_AmazingArtGalleryPagesCreated;
- private bool[] m_IsVideoLocked;
- private bool m_IsBackgroundMusicEnabled;
- private bool m_IsPrinterEnabled;
- // EdgeOfCloudNine
- private bool m_EOCN_IsSecondTime;
- private bool m_EOCN_IsCloudVisible;
- // CloudSpellingChallenge
- private int m_CSC_WinsCount;
- // CloudNineGateway
- private bool m_CNG_IsFirstClickWelcomeSign;
- private bool m_CNG_IsFirstClickPaigeWithoutBell;
- private bool m_CNG_IsFirstClickPaigeWithBell;
- private bool m_CNG_IsFirstClickPaigeAfterOpeningGate;
- private bool m_CNG_IsFirstClickReaderWithoutBell;
- private bool m_CNG_IsFirstClickReaderWithBell;
- private bool m_CNG_IsFirstClickReaderAfterOpeningGate;
- // DowntownCloudNine
- private DCN_BackTypeEnum m_DCN_BackType;
- private int m_DCN_BackAfterIrvinsHouseQueenSpeech;
- private int m_DCN_EnteredFromCatapultCount;
- private bool m_DCN_IsFirstClickCloudNineArtGallery;
- private bool m_DCN_BackAfterOneItem;
- private bool m_DCN_BackAfterTwoItems;
- private bool m_DCN_BackAfterThreeItems;
- // CloudSheepCrossing
- private bool m_CSC_IsFirstWhistle;
- private bool m_CSC_IsFirstSheepClick;
- // RaingearIslandRainbow
- private int m_RGIR_Direction;
- // NewspaperCarrierScene
- private bool m_NCS_IsSecondTime;
- private bool m_NCS_IsCarryInScene;
- private bool m_NCS_IsFirstClickRainbow;
- private bool m_NCS_IsFirstClickCarry;
- private bool m_NCS_IsFirstTimeWithWagon;
- // IrvinsHouse
- private int m_IH_GameState;
- private int m_IH_ReEntryCount;
- private bool m_IH_IsFirstFromRaingearThrowingMachine;
- // RaingearThrowingMachine
- private int m_RTM_VisitCount;
- private int m_RTM_UsedCatapultCount;
- private bool m_RTM_IsFluffySleeping;
- private bool m_RTM_IsCatapultReady;
- private bool m_RTM_IsFirstSandwich;
- // RockHead
- private int m_RH_GameState;
- private bool m_RH_IsFirstTimeFromRainbow;
- private bool m_RH_DidTalkToRockHead;
- private int m_RH_RockClickCount;
- // CloudNineArtGallery
- private int m_CNAG_GameState;
- private bool m_CNAG_DidSaySS4Speech;
- private bool m_CNAG_DidSayAct4Speech;
- private bool m_CNAG_IsFirstEditSpeech;
- private bool m_CNAG_IsFromSample;
- private int m_CNAG_VisitCount;
- // AmazingArtGallery
- private int m_AAG_NextClickCount;
- private bool m_AAG_PaigeClicked;
- private int m_AAG_Enter1Count;
- private int m_AAG_Enter2Count;
- private int m_AAG_Enter3Count;
- private bool m_AAG_PaintUsed;
- private bool m_AAG_EraseUsed;
- private bool m_AAG_StampUsed;
- private bool m_AAG_FillUsed;
- private bool m_AAG_BombUsed;
- private bool m_AAG_TwoPagesUsed;
- private bool m_AAG_PlayUsed;
- private string m_AAG_framePath; //mycode --rafael
- // RaingearForestMath
- private int m_RFM_RoundsCompleted;
- // FlowerpotPhonics
- private int m_FP_GameState;
- private bool m_FP_WagonHere;
- private Map.MapOpenedType m_MapOpenedType;
- //================================================================================
- //
- //================================================================================
- public PlayerData()
- {
- Reset();
- }
- //================================================================================
- //
- //================================================================================
- public void Reset()
- {
- m_PlayerName = "";
- if (m_Items == null)
- m_Items = new ItemState[(int)ItemEnum.Quantity];
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- m_Items[i] = ItemState.None;
- m_SandwichCount = 0;
- m_RedMarbleCount = 0;
- m_OrangeMarbleCount = 0;
- m_YellowMarbleCount = 0;
- m_GreenMarbleCount = 0;
- m_BlueMarbleCount = 0;
- m_UsedRedMarbleCount = 0;
- m_UsedOrangeMarbleCount = 0;
- m_UsedYellowMarbleCount = 0;
- m_UsedGreenMarbleCount = 0;
- m_UsedBlueMarbleCount = 0;
- if (m_Visited == null)
- m_Visited = new bool[(int)Location.Quantity];
- if (m_BlockedLocation == null)
- m_BlockedLocation = new bool[(int)Location.Quantity];
- for (int i = 0; i < (int)Location.Quantity; ++i)
- {
- m_Visited[i] = false;
- m_BlockedLocation[i] = true;
- }
- m_CurrentLocation = Location.EdgeOfCloudNine;
- m_PreviousLocation = Location.EdgeOfCloudNine;
- if (m_ActivityLevel == null)
- m_ActivityLevel = new int[(int)Activity.Quantity];
- if (m_IsActivityLocked == null)
- m_IsActivityLocked = new bool[(int)Activity.Quantity];
- if (m_IsActivityAutoLevel == null)
- m_IsActivityAutoLevel = new bool[(int)Activity.Quantity];
- for (int i = 0; i < (int)Activity.Quantity; ++i)
- {
- m_ActivityLevel[i] = 1;
- m_IsActivityLocked[i] = true;
- m_IsActivityAutoLevel[i] = true;
- }
- // We don't keep progress of Raingear Rescue and Amazing Art Gallery using ProgressType.
- // Raingear Rescue progress is defined by the number of times the player completed the activity.
- // Amazing Art Gallery progress is defined by the number of pages created in the activity.
- if (m_ProgressLevel1 == null)
- m_ProgressLevel1 = new ProgressType[(int)Activity.Quantity - 2];
- if (m_ProgressLevel2 == null)
- m_ProgressLevel2 = new ProgressType[(int)Activity.Quantity - 2];
- if (m_ProgressLevel3 == null)
- m_ProgressLevel3 = new ProgressType[(int)Activity.Quantity - 2];
- for (int i = 0; i < (int)Activity.Quantity - 2; ++i)
- {
- m_ProgressLevel1[i] = ProgressType.None;
- m_ProgressLevel2[i] = ProgressType.None;
- m_ProgressLevel3[i] = ProgressType.None;
- }
- if (m_RaingearRescueProgressLevels == null)
- m_RaingearRescueProgressLevels = new int[3];
- for (int i = 0; i < 3; ++i)
- m_RaingearRescueProgressLevels[i] = 0;
- m_AmazingArtGalleryPagesCreated = 0;
- if (m_IsVideoLocked == null)
- m_IsVideoLocked = new bool[(int)VideoType.Quantity];
- for (int i = 0; i < (int)VideoType.Quantity; ++i)
- m_IsVideoLocked[i] = true;
- m_IsBackgroundMusicEnabled = true;
- m_IsPrinterEnabled = true;
- ResetSceneSpecificVariables();
- m_MapOpenedType = Map.MapOpenedType.None;
- }
- //================================================================================
- //
- //================================================================================
- void ResetSceneSpecificVariables()
- {
- m_EOCN_IsSecondTime = false;
- m_EOCN_IsCloudVisible = true;
- m_CSC_WinsCount = 0;
- m_CNG_IsFirstClickWelcomeSign = true;
- m_CNG_IsFirstClickPaigeWithoutBell = true;
- m_CNG_IsFirstClickPaigeWithBell = true;
- m_CNG_IsFirstClickPaigeAfterOpeningGate = true;
- m_CNG_IsFirstClickReaderWithoutBell = true;
- m_CNG_IsFirstClickReaderWithBell = true;
- m_CNG_IsFirstClickReaderAfterOpeningGate = true;
- m_DCN_BackType = DCN_BackTypeEnum.DidNotVisitIslandFirstTimeOnly;
- m_DCN_BackAfterIrvinsHouseQueenSpeech = 0;
- m_DCN_EnteredFromCatapultCount = 0;
- m_DCN_IsFirstClickCloudNineArtGallery = true;
- m_DCN_BackAfterOneItem = false;
- m_DCN_BackAfterTwoItems = false;
- m_DCN_BackAfterThreeItems = false;
- m_CSC_IsFirstWhistle = true;
- m_CSC_IsFirstSheepClick = true;
- m_RGIR_Direction = 0;
- m_NCS_IsSecondTime = false;
- m_NCS_IsCarryInScene = true;
- m_NCS_IsFirstClickRainbow = true;
- m_NCS_IsFirstClickCarry = true;
- m_NCS_IsFirstTimeWithWagon = true;
- m_IH_GameState = 1;
- m_IH_ReEntryCount = 0;
- m_IH_IsFirstFromRaingearThrowingMachine = true;
- m_RTM_VisitCount = 0;
- m_RTM_UsedCatapultCount = 0;
- m_RTM_IsFluffySleeping = false;
- m_RTM_IsCatapultReady = false;
- m_RTM_IsFirstSandwich = true;
- m_RH_GameState = 1;
- m_RH_IsFirstTimeFromRainbow = true;
- m_RH_DidTalkToRockHead = false;
- m_RH_RockClickCount = 0;
- m_CNAG_GameState = 1;
- m_CNAG_DidSaySS4Speech = false;
- m_CNAG_DidSayAct4Speech = false;
- m_CNAG_IsFirstEditSpeech = true;
- m_CNAG_IsFromSample = false;
- m_CNAG_VisitCount = 0;
- m_AAG_NextClickCount = 0;
- m_AAG_PaigeClicked = false;
- m_AAG_Enter1Count = 0;
- m_AAG_Enter2Count = 0;
- m_AAG_Enter3Count = 0;
- m_AAG_PaintUsed = false;
- m_AAG_EraseUsed = false;
- m_AAG_StampUsed = false;
- m_AAG_FillUsed = false;
- m_AAG_framePath = ""; //mycode --rafael
- m_AAG_BombUsed = false;
- m_AAG_TwoPagesUsed = false;
- m_AAG_PlayUsed = false;
- m_RFM_RoundsCompleted = 0;
- m_FP_GameState = 1;
- m_FP_WagonHere = false;
- }
- //================================================================================
- //
- //================================================================================
- public bool IsPracticeMode()
- {
- return m_IsPracticeMode;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetPracticeMode(bool isPracticeMode)
- {
- m_IsPracticeMode = isPracticeMode;
- if (m_IsPracticeMode)
- {
- m_PlayerName = GameStrings.Instance().GetString(GameStringsEnum.PracticeMode);
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- m_Items[i] = ItemState.None;
- m_SandwichCount = 0;
- m_RedMarbleCount = 0;
- m_OrangeMarbleCount = 0;
- m_YellowMarbleCount = 0;
- m_GreenMarbleCount = 0;
- m_BlueMarbleCount = 0;
- m_UsedRedMarbleCount = 0;
- m_UsedOrangeMarbleCount = 0;
- m_UsedYellowMarbleCount = 0;
- m_UsedGreenMarbleCount = 0;
- m_UsedBlueMarbleCount = 0;
- for (int i = 0; i < (int)Location.Quantity; ++i)
- {
- m_Visited[i] = false;
- m_BlockedLocation[i] = true;
- }
- m_CurrentLocation = Location.Quantity;
- m_PreviousLocation = Location.Quantity;
- for (int i = 0; i < (int)Activity.Quantity; ++i)
- {
- m_ActivityLevel[i] = 1;
- m_IsActivityLocked[i] = false;
- m_IsActivityAutoLevel[i] = true;
- }
- for (int i = 0; i < (int)Activity.Quantity - 2; ++i)
- {
- m_ProgressLevel1[i] = ProgressType.None;
- m_ProgressLevel2[i] = ProgressType.None;
- m_ProgressLevel3[i] = ProgressType.None;
- }
- for (int i = 0; i < 3; ++i)
- m_RaingearRescueProgressLevels[i] = 0;
- m_AmazingArtGalleryPagesCreated = 0;
- // All videos are locked in Practice Mode.
- for (int i = 0; i < (int)VideoType.Quantity; ++i)
- m_IsVideoLocked[i] = true;
- m_IsBackgroundMusicEnabled = true;
- m_IsPrinterEnabled = true;
- ResetSceneSpecificVariables();
- }
- else
- {
- m_PlayerName = "";
- }
- }
- //================================================================================
- //
- //================================================================================
- public bool IsInActivity(Activity activity)
- {
- switch (activity)
- {
- case Activity.CloudSpellingChallenge:
- return m_CurrentLocation == Location.CloudSpellingChallenge;
- case Activity.RaingearForestMath:
- return m_CurrentLocation == Location.RaingearForestMath;
- case Activity.FlowerpotPhonics:
- return m_CurrentLocation == Location.FlowerpotPhonics;
- case Activity.SillySandwichShop:
- return m_CurrentLocation == Location.SillySandwichShop;
-
- case Activity.MusicalMarblePatterns:
- return m_CurrentLocation == Location.MusicalMarblePatterns;
-
- case Activity.GumballScience:
- return m_CurrentLocation == Location.GumballScience;
- case Activity.RaingearRescue:
- return m_CurrentLocation == Location.RaingearRescue;
- case Activity.AmazingArtGallery:
- return m_CurrentLocation == Location.AmazingArtGallery;
- }
- return false;
- }
-
- //================================================================================
- //
- //================================================================================
- public string GetPlayerName()
- {
- return m_PlayerName;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetPlayerName(string name)
- {
- m_PlayerName = name;
- }
- //================================================================================
- //
- //================================================================================
- public ItemState GetItemState(int index)
- {
- return m_Items[index];
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetItemState(ItemEnum item)
- {
- return m_Items[(int)item];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetItemState(ItemEnum item, ItemState state)
- {
- m_Items[(int)item] = state;
- }
- //================================================================================
- //
- //================================================================================
- public ItemState GetBell()
- {
- return m_Items[(int)ItemEnum.Bell];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetBell(ItemState state)
- {
- m_Items[(int)ItemEnum.Bell] = state;
- }
- //================================================================================
- //
- //================================================================================
- public ItemState GetWhistle()
- {
- return m_Items[(int)ItemEnum.Whistle];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetWhistle(ItemState state)
- {
- m_Items[(int)ItemEnum.Whistle] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetLadder()
- {
- return m_Items[(int)ItemEnum.Ladder];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetLadder(ItemState state)
- {
- m_Items[(int)ItemEnum.Ladder] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetWagon()
- {
- return m_Items[(int)ItemEnum.Wagon];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetWagon(ItemState state)
- {
- m_Items[(int)ItemEnum.Wagon] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetRubberBand()
- {
- return m_Items[(int)ItemEnum.RubberBand];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetRubberBand(ItemState state)
- {
- m_Items[(int)ItemEnum.RubberBand] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetHat()
- {
- return m_Items[(int)ItemEnum.Hat];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetHat(ItemState state)
- {
- m_Items[(int)ItemEnum.Hat] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetHoop()
- {
- return m_Items[(int)ItemEnum.Hoop];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetHoop(ItemState state)
- {
- m_Items[(int)ItemEnum.Hoop] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetPillow()
- {
- return m_Items[(int)ItemEnum.Pillow];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetPillow(ItemState state)
- {
- m_Items[(int)ItemEnum.Pillow] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetSandwich()
- {
- return m_Items[(int)ItemEnum.Sandwich];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetSandwich(ItemState state)
- {
- m_Items[(int)ItemEnum.Sandwich] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetRedMarble()
- {
- return m_Items[(int)ItemEnum.MarbleRed];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetRedMarble(ItemState state)
- {
- m_Items[(int)ItemEnum.MarbleRed] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetOrangeMarble()
- {
- return m_Items[(int)ItemEnum.MarbleOrange];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetOrangeMarble(ItemState state)
- {
- m_Items[(int)ItemEnum.MarbleOrange] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetYellowMarble()
- {
- return m_Items[(int)ItemEnum.MarbleYellow];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetYellowMarble(ItemState state)
- {
- m_Items[(int)ItemEnum.MarbleYellow] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetGreenMarble()
- {
- return m_Items[(int)ItemEnum.MarbleGreen];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetGreenMarble(ItemState state)
- {
- m_Items[(int)ItemEnum.MarbleGreen] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetBlueMarble()
- {
- return m_Items[(int)ItemEnum.MarbleBlue];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetBlueMarble(ItemState state)
- {
- m_Items[(int)ItemEnum.MarbleBlue] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetRubberBandNone()
- {
- return m_Items[(int)ItemEnum.RubberBandNone];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetRubberBandNone(ItemState state)
- {
- m_Items[(int)ItemEnum.RubberBandNone] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetHoopNone()
- {
- return m_Items[(int)ItemEnum.HoopNone];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetHoopNone(ItemState state)
- {
- m_Items[(int)ItemEnum.HoopNone] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public ItemState GetPillowNone()
- {
- return m_Items[(int)ItemEnum.PillowNone];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetPillowNone(ItemState state)
- {
- m_Items[(int)ItemEnum.PillowNone] = state;
- }
-
- //================================================================================
- //
- //================================================================================
- public int GetSandwichCount()
- {
- return m_SandwichCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetSandwichCount(int count)
- {
- m_SandwichCount = count;
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncSandwichCount()
- {
- ++m_SandwichCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DecSandwichCount()
- {
- --m_SandwichCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public int GetRedMarbleCount()
- {
- return m_RedMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetRedMarbleCount(int count)
- {
- m_RedMarbleCount = count;
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncRedMarbleCount()
- {
- ++m_RedMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DecRedMarbleCount()
- {
- --m_RedMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public int GetOrangeMarbleCount()
- {
- return m_OrangeMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetOrangeMarbleCount(int count)
- {
- m_OrangeMarbleCount = count;
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncOrangeMarbleCount()
- {
- ++m_OrangeMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DecOrangeMarbleCount()
- {
- --m_OrangeMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public int GetYellowMarbleCount()
- {
- return m_YellowMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetYellowMarbleCount(int count)
- {
- m_YellowMarbleCount = count;
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncYellowMarbleCount()
- {
- ++m_YellowMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DecYellowMarbleCount()
- {
- --m_YellowMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public int GetGreenMarbleCount()
- {
- return m_GreenMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetGreenMarbleCount(int count)
- {
- m_GreenMarbleCount = count;
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncGreenMarbleCount()
- {
- ++m_GreenMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DecGreenMarbleCount()
- {
- --m_GreenMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public int GetBlueMarbleCount()
- {
- return m_BlueMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetBlueMarbleCount(int count)
- {
- m_BlueMarbleCount = count;
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncBlueMarbleCount()
- {
- ++m_BlueMarbleCount;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DecBlueMarbleCount()
- {
- --m_BlueMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public bool DidVisit(int locationIndex)
- {
- return m_Visited[locationIndex];
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisit(Location location)
- {
- return m_Visited[(int)location];
- }
- //================================================================================
- //
- //================================================================================
- public bool DidVisit(SceneIndex sceneIndex)
- {
- switch (sceneIndex)
- {
- case SceneIndex.AmazingArtGallery:
- return m_Visited[(int)Location.AmazingArtGallery];
- case SceneIndex.CloudNineArtGallery:
- return m_Visited[(int)Location.CloudNineArtGallery];
- case SceneIndex.CloudNineGateway:
- return m_Visited[(int)Location.CloudNineGateway];
- case SceneIndex.CloudSheepCrossing:
- return m_Visited[(int)Location.CloudSheepCrossing];
- case SceneIndex.CloudSpellingChallenge:
- return m_Visited[(int)Location.CloudSpellingChallenge];
- case SceneIndex.DowntownCloudNine:
- return m_Visited[(int)Location.DowntownCloudNine];
- case SceneIndex.EdgeOfCloudNine:
- return m_Visited[(int)Location.EdgeOfCloudNine];
- case SceneIndex.FlowerpotPhonics:
- return m_Visited[(int)Location.FlowerpotPhonics];
- case SceneIndex.GumballScience:
- return m_Visited[(int)Location.GumballScience];
- case SceneIndex.IrvinsHouse:
- return m_Visited[(int)Location.IrvinsHouse];
- case SceneIndex.MusicalMarblePatterns:
- return m_Visited[(int)Location.MusicalMarblePatterns];
- case SceneIndex.NewspaperCarrierScene:
- return m_Visited[(int)Location.NewspaperCarrierScene];
- case SceneIndex.RaingearForest:
- return m_Visited[(int)Location.RaingearForest];
- case SceneIndex.RaingearForestMath:
- return m_Visited[(int)Location.RaingearForestMath];
- case SceneIndex.RaingearIsland:
- return m_Visited[(int)Location.RaingearIsland];
- case SceneIndex.RaingearRescue:
- return m_Visited[(int)Location.RaingearRescue];
- case SceneIndex.RaingearThrowingMachine:
- return m_Visited[(int)Location.RaingearThrowingMachine];
- case SceneIndex.RockHead:
- return m_Visited[(int)Location.RockHead];
- case SceneIndex.SillySandwichShop:
- return m_Visited[(int)Location.SillySandwichShop];
- }
- return false;
- }
- //================================================================================
- //
- //================================================================================
- public bool DidVisit(Activity activity)
- {
- switch (activity)
- {
- case Activity.CloudSpellingChallenge:
- return m_Visited[(int)Location.CloudSpellingChallenge];
- case Activity.RaingearForestMath:
- return m_Visited[(int)Location.RaingearForestMath];
- case Activity.FlowerpotPhonics:
- return m_Visited[(int)Location.FlowerpotPhonics];
- case Activity.SillySandwichShop:
- return m_Visited[(int)Location.SillySandwichShop];
- case Activity.MusicalMarblePatterns:
- return m_Visited[(int)Location.MusicalMarblePatterns];
- case Activity.GumballScience:
- return m_Visited[(int)Location.GumballScience];
- case Activity.RaingearRescue:
- return m_Visited[(int)Location.RaingearRescue];
- case Activity.AmazingArtGallery:
- return m_Visited[(int)Location.AmazingArtGallery];
- }
- return false;
- }
- //================================================================================
- //
- //================================================================================
- public void SetVisited(Location location, bool visited)
- {
- m_Visited[(int)location] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitEdgeOfCloudNine()
- {
- return m_Visited[(int)Location.EdgeOfCloudNine];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedEdgeOfCloudNine(bool visited)
- {
- m_Visited[(int)Location.EdgeOfCloudNine] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitCloudNineGateway()
- {
- return m_Visited[(int)Location.CloudNineGateway];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedCloudNineGateway(bool visited)
- {
- m_Visited[(int)Location.CloudNineGateway] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitCloudSpellingChallenge()
- {
- return m_Visited[(int)Location.CloudSpellingChallenge];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedCloudSpellingChallenge(bool visited)
- {
- m_Visited[(int)Location.CloudSpellingChallenge] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitDowntownCloudNine()
- {
- return m_Visited[(int)Location.DowntownCloudNine];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedDowntownCloudNine(bool visited)
- {
- m_Visited[(int)Location.DowntownCloudNine] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitCloudNineArtGallery()
- {
- return m_Visited[(int)Location.CloudNineArtGallery];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedCloudNineArtGallery(bool visited)
- {
- m_Visited[(int)Location.CloudNineArtGallery] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitAmazingArtGallery()
- {
- return m_Visited[(int)Location.AmazingArtGallery];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedAmazingArtGallery(bool visited)
- {
- m_Visited[(int)Location.AmazingArtGallery] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitCloudSheepCrossing()
- {
- return m_Visited[(int)Location.CloudSheepCrossing];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedCloudSheepCrossing(bool visited)
- {
- m_Visited[(int)Location.CloudSheepCrossing] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitNewspaperCarrierScene()
- {
- return m_Visited[(int)Location.NewspaperCarrierScene];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedNewspaperCarrierScene(bool visited)
- {
- m_Visited[(int)Location.NewspaperCarrierScene] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitRaingearIsland()
- {
- return m_Visited[(int)Location.RaingearIsland];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedRaingearIsland(bool visited)
- {
- m_Visited[(int)Location.RaingearIsland] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitIrvinsHouse()
- {
- return m_Visited[(int)Location.IrvinsHouse];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedIrvinsHouse(bool visited)
- {
- m_Visited[(int)Location.IrvinsHouse] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitGumballScience()
- {
- return m_Visited[(int)Location.GumballScience];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedGumballScience(bool visited)
- {
- m_Visited[(int)Location.GumballScience] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitRaingearThrowingMachine()
- {
- return m_Visited[(int)Location.RaingearThrowingMachine];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedRaingearThrowingMachine(bool visited)
- {
- m_Visited[(int)Location.RaingearThrowingMachine] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitMusicalMarblePatterns()
- {
- return m_Visited[(int)Location.MusicalMarblePatterns];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedMusicalMarblePatterns(bool visited)
- {
- m_Visited[(int)Location.MusicalMarblePatterns] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitRaingearForest()
- {
- return m_Visited[(int)Location.RaingearForest];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedRaingearForest(bool visited)
- {
- m_Visited[(int)Location.RaingearForest] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitRaingearForestMath()
- {
- return m_Visited[(int)Location.RaingearForestMath];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedRaingearForestMath(bool visited)
- {
- m_Visited[(int)Location.RaingearForestMath] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitSillySandwichShop()
- {
- return m_Visited[(int)Location.SillySandwichShop];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedSillySandwichShop(bool visited)
- {
- m_Visited[(int)Location.SillySandwichShop] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitRockHead()
- {
- return m_Visited[(int)Location.RockHead];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedRockHead(bool visited)
- {
- m_Visited[(int)Location.RockHead] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitFlowerpotPhonics()
- {
- return m_Visited[(int)Location.FlowerpotPhonics];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedFlowerpotPhonics(bool visited)
- {
- m_Visited[(int)Location.FlowerpotPhonics] = visited;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool DidVisitRaingearRescue()
- {
- return m_Visited[(int)Location.RaingearRescue];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetVisitedRaingearRescue(bool visited)
- {
- m_Visited[(int)Location.RaingearRescue] = visited;
- }
- //================================================================================
- //
- //================================================================================
- public Location GetCurrentLocation()
- {
- return m_CurrentLocation;
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetCurrentLocation(Location location)
- {
- m_PreviousLocation = m_CurrentLocation;
- m_CurrentLocation = location;
- }
- //================================================================================
- //
- //================================================================================
- public Location GetPreviousLocation()
- {
- return m_PreviousLocation;
- }
- //================================================================================
- //
- //================================================================================
- public bool MustUnblock(Location location)
- {
- return BlockedLocation[(int)location];
- }
-
- //================================================================================
- //
- //================================================================================
- public bool IsLocationBlocked(Location location)
- {
- return m_BlockedLocation[(int)location];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetLocationBlocked(Location location, bool blocked)
- {
- m_BlockedLocation[(int)location] = blocked;
- }
-
- //================================================================================
- //
- //================================================================================
- public void BlockLocation(Location location)
- {
- m_BlockedLocation[(int)location] = true;
- }
-
- //================================================================================
- //
- //================================================================================
- public void UnblockLocation(Location location)
- {
- m_BlockedLocation[(int)location] = false;
- }
-
-
- //================================================================================
- //
- //================================================================================
- public int GetActivityLevel(Activity activity)
- {
- return m_ActivityLevel[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetActivityLevel(Activity activity, int level)
- {
- m_ActivityLevel[(int)activity] = level;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool IsActivityLocked(Activity activity)
- {
- return m_IsActivityLocked[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public void LockActivity(Activity activity)
- {
- m_IsActivityLocked[(int)activity] = true;
- }
-
- //================================================================================
- //
- //================================================================================
- public void UnlockActivity(Activity activity)
- {
- m_IsActivityLocked[(int)activity] = false;
- }
-
- //================================================================================
- //
- //================================================================================
- public void ToggleActivityLocked(Activity activity)
- {
- m_IsActivityLocked[(int)activity] = !m_IsActivityLocked[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public bool IsActivityAutoLevel(Activity activity)
- {
- return m_IsActivityAutoLevel[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetActivityAutoLevel(Activity activity, bool isAutoLevel)
- {
- m_IsActivityAutoLevel[(int)activity] = isAutoLevel;
- }
-
- //================================================================================
- //
- //================================================================================
- public void ToggleActivityAutoLevel(Activity activity)
- {
- m_IsActivityAutoLevel[(int)activity] = !m_IsActivityAutoLevel[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public ProgressType GetProgressTypeLevel1(Activity activity)
- {
- return m_ProgressLevel1[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetProgressTypeLevel1(Activity activity, ProgressType progressType)
- {
- m_ProgressLevel1[(int)activity] = progressType;
- }
-
- //================================================================================
- //
- //================================================================================
- public ProgressType GetProgressTypeLevel2(Activity activity)
- {
- return m_ProgressLevel2[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetProgressTypeLevel2(Activity activity, ProgressType progressType)
- {
- m_ProgressLevel2[(int)activity] = progressType;
- }
-
- //================================================================================
- //
- //================================================================================
- public ProgressType GetProgressTypeLevel3(Activity activity)
- {
- return m_ProgressLevel3[(int)activity];
- }
-
- //================================================================================
- //
- //================================================================================
- public void SetProgressTypeLevel3(Activity activity, ProgressType progressType)
- {
- m_ProgressLevel3[(int)activity] = progressType;
- }
- //================================================================================
- //
- //================================================================================
- public int GetRaingearRescueProgress(int level)
- {
- return m_RaingearRescueProgressLevels[level];
- }
-
- //================================================================================
- //
- //================================================================================
- public void IncRaingearRescueProgress(int level)
- {
- ++m_RaingearRescueProgressLevels[level];
- }
-
- //================================================================================
- //
- //================================================================================
- public int GetAmazingArtGalleryPagesCreated()
- {
- return m_AmazingArtGalleryPagesCreated;
- }
-
- //================================================================================
- // We consider that a page is created only when the player first modify it.
- // If the player go to "next" page but does nothing on the new page, we do not
- // count it as a new page created.
- //================================================================================
- public void IncAmazingArtGalleryPagesCreated()
- {
- ++m_AmazingArtGalleryPagesCreated;
- }
- //================================================================================
- //
- //================================================================================
- public bool IsVideoLocked(VideoType video)
- {
- return m_IsVideoLocked[(int)video];
- }
-
- //================================================================================
- //
- //================================================================================
- public void LockVideo(VideoType video)
- {
- m_IsVideoLocked[(int)video] = true;
- }
-
- //================================================================================
- //
- //================================================================================
- public void UnlockVideo(VideoType video)
- {
- m_IsVideoLocked[(int)video] = false;
- }
-
- //================================================================================
- //
- //================================================================================
- public void ToggleVideoLocked(VideoType video)
- {
- m_IsVideoLocked[(int)video] = !m_IsVideoLocked[(int)video];
- }
- //================================================================================
- //
- //================================================================================
- public bool IsBackgroundMusicEnabled()
- {
- return m_IsBackgroundMusicEnabled;
- }
-
- //================================================================================
- //
- //================================================================================
- public void EnableBackgroundMusic()
- {
- m_IsBackgroundMusicEnabled = true;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DisableBackgroundMusic()
- {
- m_IsBackgroundMusicEnabled = false;
- }
-
- //================================================================================
- //
- //================================================================================
- public void ToggleBackgroundMusic()
- {
- m_IsBackgroundMusicEnabled = !m_IsBackgroundMusicEnabled;
- }
-
- //================================================================================
- //
- //================================================================================
- public bool IsPrinterEnabled()
- {
- return m_IsPrinterEnabled;
- }
-
- //================================================================================
- //
- //================================================================================
- public void EnablePrinter()
- {
- m_IsPrinterEnabled = true;
- }
-
- //================================================================================
- //
- //================================================================================
- public void DisablePrinter()
- {
- m_IsPrinterEnabled = false;
- }
-
- //================================================================================
- //
- //================================================================================
- public void TogglePrinter()
- {
- m_IsPrinterEnabled = !m_IsPrinterEnabled;
- }
- //================================================================================
- // EdgeOfCloudNine
- //================================================================================
- public bool EOCN_IsSecondTime
- {
- get { return m_EOCN_IsSecondTime; }
- set { m_EOCN_IsSecondTime = value; }
- }
- public bool EOCN_IsCloudVisible
- {
- get { return m_EOCN_IsCloudVisible; }
- set { m_EOCN_IsCloudVisible = value; }
- }
- //================================================================================
- // CloudSpellingChallenge
- //================================================================================
-
- public int CSC_WinsCount{
- get { return m_CSC_WinsCount; }
- set { m_CSC_WinsCount = value; }
- }
- //================================================================================
- // CloudNineGateway
- //================================================================================
- public bool CNG_IsFirstClickWelcomeSign
- {
- get { return m_CNG_IsFirstClickWelcomeSign; }
- set { m_CNG_IsFirstClickWelcomeSign = value; }
- }
- public bool CNG_IsFirstClickPaigeWithoutBell
- {
- get { return m_CNG_IsFirstClickPaigeWithoutBell; }
- set { m_CNG_IsFirstClickPaigeWithoutBell = value; }
- }
- public bool CNG_IsFirstClickPaigeWithBell
- {
- get { return m_CNG_IsFirstClickPaigeWithBell; }
- set { m_CNG_IsFirstClickPaigeWithBell = value; }
- }
- public bool CNG_IsFirstClickPaigeAfterOpeningGate
- {
- get { return m_CNG_IsFirstClickPaigeAfterOpeningGate; }
- set { m_CNG_IsFirstClickPaigeAfterOpeningGate = value; }
- }
- public bool CNG_IsFirstClickReaderWithoutBell
- {
- get { return m_CNG_IsFirstClickReaderWithoutBell; }
- set { m_CNG_IsFirstClickReaderWithoutBell = value; }
- }
- public bool CNG_IsFirstClickReaderWithBell
- {
- get { return m_CNG_IsFirstClickReaderWithBell; }
- set { m_CNG_IsFirstClickReaderWithBell = value; }
- }
- public bool CNG_IsFirstClickReaderAfterOpeningGate
- {
- get { return m_CNG_IsFirstClickReaderAfterOpeningGate; }
- set { m_CNG_IsFirstClickReaderAfterOpeningGate = value; }
- }
- //================================================================================
- // DowntownCloudNine
- //================================================================================
- public DCN_BackTypeEnum DCN_BackType
- {
- get { return m_DCN_BackType; }
- set { m_DCN_BackType = value; }
- }
- public int DCN_BackAfterIrvinsHouseQueenSpeech
- {
- get { return m_DCN_BackAfterIrvinsHouseQueenSpeech; }
- set { m_DCN_BackAfterIrvinsHouseQueenSpeech = value; }
- }
- public int DCN_EnteredFromCatapult
- {
- get { return m_DCN_EnteredFromCatapultCount; }
- set { m_DCN_EnteredFromCatapultCount = value; }
- }
- public bool DCN_IsFirstClickCloudNineArtGallery
- {
- get { return m_DCN_IsFirstClickCloudNineArtGallery; }
- set { m_DCN_IsFirstClickCloudNineArtGallery = value; }
- }
- public bool DCN_BackAfterOneItem
- {
- get { return m_DCN_BackAfterOneItem; }
- set { m_DCN_BackAfterOneItem = value; }
- }
- public bool DCN_BackAfterTwoItems
- {
- get { return m_DCN_BackAfterTwoItems; }
- set { m_DCN_BackAfterTwoItems = value; }
- }
- public bool DCN_BackAfterThreeItems
- {
- get { return m_DCN_BackAfterThreeItems; }
- set { m_DCN_BackAfterThreeItems = value; }
- }
- public void DCN_VisitedRaingearIsland()
- {
- if (m_DCN_BackType == DCN_BackTypeEnum.DidNotVisitIslandFirstTimeOnly || m_DCN_BackType == DCN_BackTypeEnum.DidNotVisitIsland)
- m_DCN_BackType = DCN_BackTypeEnum.AfterVisitingIslandFirstTimeOnly;
- }
- public void DCN_VisitedIrvinsHouse()
- {
- if (m_DCN_BackType != DCN_BackTypeEnum.AfterVisitingIrvinsHouseFirstTimeOnly && m_DCN_BackType != DCN_BackTypeEnum.AfterVisitingIrvinsHouse)
- m_DCN_BackType = DCN_BackTypeEnum.AfterVisitingIrvinsHouseFirstTimeOnly;
- }
- //================================================================================
- // CloudSheepCrossing
- //================================================================================
- public bool CSC_IsFirstWhistle
- {
- get { return m_CSC_IsFirstWhistle; }
- set { m_CSC_IsFirstWhistle = value; }
- }
- public bool CSC_IsFirstSheepClick
- {
- get { return m_CSC_IsFirstSheepClick; }
- set { m_CSC_IsFirstSheepClick = value; }
- }
- //================================================================================
- // RaingearIsland
- //================================================================================
- public int RGIR_Direction
- {
- get { return m_RGIR_Direction; }
- set { m_RGIR_Direction = value; }
- }
- //================================================================================
- // NewspaperCarrierScene
- //================================================================================
- public bool NCS_IsSecondTime
- {
- get { return m_NCS_IsSecondTime; }
- set { m_NCS_IsSecondTime = value; }
- }
- public bool NCS_IsCarryInScene
- {
- get { return m_NCS_IsCarryInScene; }
- set { m_NCS_IsCarryInScene = value; }
- }
- public bool NCS_IsFirstClickRainbow
- {
- get { return m_NCS_IsFirstClickRainbow; }
- set { m_NCS_IsFirstClickRainbow = value; }
- }
- public bool NCS_IsFirstClickCarry
- {
- get { return m_NCS_IsFirstClickCarry; }
- set { m_NCS_IsFirstClickCarry = value; }
- }
- public bool NCS_IsFirstTimeWithWagon
- {
- get { return m_NCS_IsFirstTimeWithWagon; }
- set { m_NCS_IsFirstTimeWithWagon = value; }
- }
- //================================================================================
- // IrvinsHouse
- //================================================================================
- public int IH_GameState
- {
- get { return m_IH_GameState; }
- set { m_IH_GameState = value; }
- }
- public int IH_ReEntryCount
- {
- get { return m_IH_ReEntryCount; }
- set { m_IH_ReEntryCount = value; }
- }
- public bool IH_IsFirstFromRaingearThrowingMachine
- {
- get { return m_IH_IsFirstFromRaingearThrowingMachine; }
- set { m_IH_IsFirstFromRaingearThrowingMachine = value; }
- }
- //================================================================================
- // RaingearThrowingMachine
- //================================================================================
- public int RTM_VisitCount
- {
- get { return m_RTM_VisitCount; }
- set { m_RTM_VisitCount = value; }
- }
- public int RTM_UsedCatapultCount
- {
- get { return m_RTM_UsedCatapultCount; }
- set { m_RTM_UsedCatapultCount = value; }
- }
- public bool RTM_IsFluffySleeping
- {
- get { return m_RTM_IsFluffySleeping; }
- set { m_RTM_IsFluffySleeping = value; }
- }
-
- public bool RTM_IsCatapultReady
- {
- get { return m_RTM_IsCatapultReady; }
- set { m_RTM_IsCatapultReady = value; }
- }
- public bool RTM_IsFirstSandwich
- {
- get { return m_RTM_IsFirstSandwich; }
- set { m_RTM_IsFirstSandwich = value; }
- }
- //================================================================================
- // RockHead
- //================================================================================
- public int RH_GameState
- {
- get { return m_RH_GameState; }
- set { m_RH_GameState = value; }
- }
- public bool RH_IsFirstTimeFromRainbow
- {
- get { return m_RH_IsFirstTimeFromRainbow; }
- set { m_RH_IsFirstTimeFromRainbow = value; }
- }
- public bool RH_DidTalkToRockHead
- {
- get { return m_RH_DidTalkToRockHead; }
- set { m_RH_DidTalkToRockHead = value; }
- }
- public int RH_RockClickCount
- {
- get { return m_RH_RockClickCount; }
- set { m_RH_RockClickCount = value; }
- }
- //================================================================================
- // CloudNineArtGallery
- //================================================================================
- public int CNAG_GameState
- {
- get { return m_CNAG_GameState; }
- set { m_CNAG_GameState = value; }
- }
- public bool CNAG_DidSaySS4Speech
- {
- get { return m_CNAG_DidSaySS4Speech; }
- set { m_CNAG_DidSaySS4Speech = value; }
- }
- public bool CNAG_DidSayAct4Speech
- {
- get { return m_CNAG_DidSayAct4Speech; }
- set { m_CNAG_DidSayAct4Speech = value; }
- }
- public bool CNAG_IsFirstEditSpeech
- {
- get { return m_CNAG_IsFirstEditSpeech; }
- set { m_CNAG_IsFirstEditSpeech = value; }
- }
- public bool CNAG_IsFromSample
- {
- get { return m_CNAG_IsFromSample; }
- set { m_CNAG_IsFromSample = value; }
- }
- public int CNAG_VisitCount
- {
- get { return m_CNAG_VisitCount; }
- set { m_CNAG_VisitCount = value; }
- }
- //================================================================================
- // AmazingArtGallery
- //================================================================================
- public int AAG_NextClickCount
- {
- get { return m_AAG_NextClickCount; }
- set { m_AAG_NextClickCount = value; }
- }
- public bool AAG_PaigeClicked
- {
- get { return m_AAG_PaigeClicked; }
- set { m_AAG_PaigeClicked = value; }
- }
- public int AAG_Enter1Count
- {
- get { return m_AAG_Enter1Count; }
- set { m_AAG_Enter1Count = value; }
- }
- public int AAG_Enter2Count
- {
- get { return m_AAG_Enter2Count; }
- set { m_AAG_Enter2Count = value; }
- }
- public int AAG_Enter3Count
- {
- get { return m_AAG_Enter3Count; }
- set { m_AAG_Enter3Count = value; }
- }
- public bool AAG_PaintUsed
- {
- get { return m_AAG_PaintUsed; }
- set { m_AAG_PaintUsed = value; }
- }
- public bool AAG_EraseUsed
- {
- get { return m_AAG_EraseUsed; }
- set { m_AAG_EraseUsed = value; }
- }
- public bool AAG_StampUsed
- {
- get { return m_AAG_StampUsed; }
- set { m_AAG_StampUsed = value; }
- }
- public bool AAG_FillUsed
- {
- get { return m_AAG_FillUsed; }
- set { m_AAG_FillUsed = value; }
- }
- public string AAG_framePath //mycode --rafael
- {
- get { return m_AAG_framePath;}
- set { m_AAG_framePath = value;}
- }
- public bool AAG_BombUsed
- {
- get { return m_AAG_BombUsed; }
- set { m_AAG_BombUsed = value; }
- }
- public bool AAG_TwoPagesUsed
- {
- get { return m_AAG_TwoPagesUsed; }
- set { m_AAG_TwoPagesUsed = value; }
- }
- public bool AAG_PlayUsed
- {
- get { return m_AAG_PlayUsed; }
- set { m_AAG_PlayUsed = value; }
- }
- //================================================================================
- // RaingearForestMath
- //================================================================================
- public int RFM_RoundsCompleted
- {
- get { return m_RFM_RoundsCompleted; }
- set { m_RFM_RoundsCompleted = value; }
- }
-
- //================================================================================
- // FlowerpotPhonics
- //================================================================================
- public int FP_GameState
- {
- get { return m_FP_GameState; }
- set { m_FP_GameState = value; }
- }
- public bool FP_WagonHere
- {
- get { return m_FP_WagonHere; }
- set { m_FP_WagonHere = value; }
- }
- //================================================================================
- //
- //================================================================================
- public Map.MapOpenedType CurrentMapOpenedType
- {
- get { return m_MapOpenedType; }
- set { m_MapOpenedType = value; }
- }
- //================================================================================
- //
- //================================================================================
- public bool LoadData()
- {
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("Calling PlayerData.LoadData()...");
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("Persistent data path: " + Application.persistentDataPath);
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("Player name is " + m_PlayerName);
- string playerName = m_IsPracticeMode ? PRACTICE_MODE_FILENAME : m_PlayerName;
- if (ES2.Exists(playerName + ".dat"))
- {
- // Loading data sequentially (without tags) for faster save/load data - loading must be in the same sequence.
- using(ES2Reader reader = ES2Reader.Create(playerName + ".dat"))
- {
- reader.Read<string>(); // We don't need to save player name, since we already got that in sign-in screen.
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- m_Items[i] = (ItemState)reader.Read<int>();
- m_SandwichCount = reader.Read<int>();
- m_RedMarbleCount = reader.Read<int>();
- m_OrangeMarbleCount = reader.Read<int>();
- m_YellowMarbleCount = reader.Read<int>();
- m_GreenMarbleCount = reader.Read<int>();
- m_BlueMarbleCount = reader.Read<int>();
- m_UsedRedMarbleCount = reader.Read<int>();
- m_UsedOrangeMarbleCount = reader.Read<int>();
- m_UsedYellowMarbleCount = reader.Read<int>();
- m_UsedGreenMarbleCount = reader.Read<int>();
- m_UsedBlueMarbleCount = reader.Read<int>();
- m_Visited = reader.ReadArray<bool>();
- m_CurrentLocation = (Location)reader.Read<int>();
- m_PreviousLocation = (Location)reader.Read<int>();
- m_BlockedLocation = reader.ReadArray<bool>();
- m_ActivityLevel = reader.ReadArray<int>();
- m_IsActivityLocked = reader.ReadArray<bool>();
- m_IsActivityAutoLevel = reader.ReadArray<bool>();
- for (int i = 0; i < (int)Activity.Quantity - 2; ++i)
- {
- m_ProgressLevel1[i] = (ProgressType)reader.Read<int>();
- m_ProgressLevel2[i] = (ProgressType)reader.Read<int>();
- m_ProgressLevel3[i] = (ProgressType)reader.Read<int>();
- }
- m_RaingearRescueProgressLevels = reader.ReadArray<int>();
- m_AmazingArtGalleryPagesCreated = reader.Read<int>();
- m_IsVideoLocked = reader.ReadArray<bool>();
- m_IsBackgroundMusicEnabled = reader.Read<bool>();
- m_IsPrinterEnabled = reader.Read<bool>();
- m_EOCN_IsSecondTime = reader.Read<bool>();
- m_EOCN_IsCloudVisible = reader.Read<bool>();
- m_CSC_WinsCount = reader.Read<int>();
- m_CNG_IsFirstClickWelcomeSign = reader.Read<bool>();
- m_CNG_IsFirstClickPaigeWithoutBell = reader.Read<bool>();
- m_CNG_IsFirstClickPaigeWithBell = reader.Read<bool>();
- m_CNG_IsFirstClickPaigeAfterOpeningGate = reader.Read<bool>();
- m_CNG_IsFirstClickReaderWithoutBell = reader.Read<bool>();
- m_CNG_IsFirstClickReaderWithBell = reader.Read<bool>();
- m_CNG_IsFirstClickReaderAfterOpeningGate = reader.Read<bool>();
- m_DCN_BackType = (DCN_BackTypeEnum)reader.Read<int>();
- m_DCN_BackAfterIrvinsHouseQueenSpeech = reader.Read<int>();
- m_DCN_EnteredFromCatapultCount = reader.Read<int>();
- m_DCN_IsFirstClickCloudNineArtGallery = reader.Read<bool>();
- m_DCN_BackAfterOneItem = reader.Read<bool>();
- m_DCN_BackAfterTwoItems = reader.Read<bool>();
- m_DCN_BackAfterThreeItems = reader.Read<bool>();
- m_CSC_IsFirstWhistle = reader.Read<bool>();
- m_CSC_IsFirstSheepClick = reader.Read<bool>();
- m_RGIR_Direction = reader.Read<int>();
- m_NCS_IsSecondTime = reader.Read<bool>();
- m_NCS_IsCarryInScene = reader.Read<bool>();
- m_NCS_IsFirstClickRainbow = reader.Read<bool>();
- m_NCS_IsFirstClickCarry = reader.Read<bool>();
- m_NCS_IsFirstTimeWithWagon = reader.Read<bool>();
- m_IH_GameState = reader.Read<int>();
- m_IH_ReEntryCount = reader.Read<int>();
- m_IH_IsFirstFromRaingearThrowingMachine = reader.Read<bool>();
- m_RTM_VisitCount = reader.Read<int>();
- m_RTM_UsedCatapultCount = reader.Read<int>();
- m_RTM_IsFluffySleeping = reader.Read<bool>();
- m_RTM_IsCatapultReady = reader.Read<bool>();
- m_RTM_IsFirstSandwich = reader.Read<bool>();
- m_RH_GameState = reader.Read<int>();
- m_RH_IsFirstTimeFromRainbow = reader.Read<bool>();
- m_RH_DidTalkToRockHead = reader.Read<bool>();
- m_RH_RockClickCount = reader.Read<int>();
- m_CNAG_GameState = reader.Read<int>();
- m_CNAG_DidSaySS4Speech = reader.Read<bool>();
- m_CNAG_DidSayAct4Speech = reader.Read<bool>();
- m_CNAG_IsFirstEditSpeech = reader.Read<bool>();
- m_CNAG_IsFromSample = reader.Read<bool>();
- m_CNAG_VisitCount = reader.Read<int>();
- m_AAG_NextClickCount = reader.Read<int>();
- m_AAG_PaigeClicked = reader.Read<bool>();
- m_AAG_Enter1Count = reader.Read<int>();
- m_AAG_Enter2Count = reader.Read<int>();
- m_AAG_Enter3Count = reader.Read<int>();
- m_AAG_PaintUsed = reader.Read<bool>();
- m_AAG_EraseUsed = reader.Read<bool>();
- m_AAG_StampUsed = reader.Read<bool>();
- m_AAG_FillUsed = reader.Read<bool>();
- m_AAG_framePath = reader.Read<string>(); //mycode --rafael
- m_AAG_BombUsed = reader.Read<bool>();
- m_AAG_TwoPagesUsed = reader.Read<bool>();
- m_AAG_PlayUsed = reader.Read<bool>();
- m_RFM_RoundsCompleted = reader.Read<int>();
- m_FP_GameState = reader.Read<int>();
- m_FP_WagonHere = reader.Read<bool>();
- m_MapOpenedType = (Map.MapOpenedType)reader.Read<int>();
- }
- return true;
- }
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("There is no save data for \'" + m_PlayerName + "\'!");
- return false;
- /*
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- m_Items[i] = (ItemState)ES2.Load<int>(m_PlayerName + ".dat?tag=it" + i);
- m_SandwichCount = ES2.Load<int>(m_PlayerName + ".dat?tag=sa");
- m_RedMarbleCount = ES2.Load<int>(m_PlayerName + ".dat?tag=re");
- m_OrangeMarbleCount = ES2.Load<int>(m_PlayerName + ".dat?tag=or");
- m_YellowMarbleCount = ES2.Load<int>(m_PlayerName + ".dat?tag=ye");
- m_GreenMarbleCount = ES2.Load<int>(m_PlayerName + ".dat?tag=gr");
- m_BlueMarbleCount = ES2.Load<int>(m_PlayerName + ".dat?tag=bl");
-
- for (int i = 0; i < (int)Location.Quantity; ++i)
- m_Visited[i] = ES2.Load<bool>(m_PlayerName + ".dat?tag=vi" + i);
-
- m_CurrentLocation = (Location)ES2.Load<int>(m_PlayerName + ".dat?tag=cu");
-
- m_IsCloudVisible = ES2.Load<bool>(m_PlayerName + ".dat?tag=is");
-
- for (int i = 0; i < (int)Location.Quantity; ++i)
- m_Blocked[i] = ES2.Load<bool>(m_PlayerName + ".dat?tag=bl" + i);
- */
- }
-
- //================================================================================
- //
- //================================================================================
- public void SaveData()
- {
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("Calling PlayerData.SaveData()...");
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("Persistent data path: " + Application.persistentDataPath);
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log("Player name is " + m_PlayerName);
- string playerName = m_IsPracticeMode ? PRACTICE_MODE_FILENAME : m_PlayerName;
- // Saving data sequentially (without tags) for faster save/load data - loading must be in the same sequence.
- using(ES2Writer writer = ES2Writer.Create(playerName + ".dat"))
- {
- writer.Write(m_PlayerName);
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- writer.Write((int)m_Items[i]);
- writer.Write(m_SandwichCount);
- writer.Write(m_RedMarbleCount);
- writer.Write(m_OrangeMarbleCount);
- writer.Write(m_YellowMarbleCount);
- writer.Write(m_GreenMarbleCount);
- writer.Write(m_BlueMarbleCount);
- writer.Write(m_UsedRedMarbleCount);
- writer.Write(m_UsedOrangeMarbleCount);
- writer.Write(m_UsedYellowMarbleCount);
- writer.Write(m_UsedGreenMarbleCount);
- writer.Write(m_UsedBlueMarbleCount);
- writer.Write(m_Visited);
- writer.Write((int)m_CurrentLocation);
- writer.Write((int)m_PreviousLocation);
- writer.Write(m_BlockedLocation);
- writer.Write(m_ActivityLevel);
- writer.Write(m_IsActivityLocked);
- writer.Write(m_IsActivityAutoLevel);
- for (int i = 0; i < (int)Activity.Quantity - 2; ++i)
- {
- writer.Write((int)m_ProgressLevel1[i]);
- writer.Write((int)m_ProgressLevel2[i]);
- writer.Write((int)m_ProgressLevel3[i]);
- }
- writer.Write(m_RaingearRescueProgressLevels);
- writer.Write(m_AmazingArtGalleryPagesCreated);
- writer.Write(m_IsVideoLocked);
- writer.Write(m_IsBackgroundMusicEnabled);
- writer.Write(m_IsPrinterEnabled);
- writer.Write(m_EOCN_IsSecondTime);
- writer.Write(m_EOCN_IsCloudVisible);
- writer.Write(m_CSC_WinsCount);
- writer.Write(m_CNG_IsFirstClickWelcomeSign);
- writer.Write(m_CNG_IsFirstClickPaigeWithoutBell);
- writer.Write(m_CNG_IsFirstClickPaigeWithBell);
- writer.Write(m_CNG_IsFirstClickPaigeAfterOpeningGate);
- writer.Write(m_CNG_IsFirstClickReaderWithoutBell);
- writer.Write(m_CNG_IsFirstClickReaderWithBell);
- writer.Write(m_CNG_IsFirstClickReaderAfterOpeningGate);
- writer.Write((int)m_DCN_BackType);
- writer.Write(m_DCN_BackAfterIrvinsHouseQueenSpeech);
- writer.Write(m_DCN_EnteredFromCatapultCount);
- writer.Write(m_DCN_IsFirstClickCloudNineArtGallery);
- writer.Write(m_DCN_BackAfterOneItem);
- writer.Write(m_DCN_BackAfterTwoItems);
- writer.Write(m_DCN_BackAfterThreeItems);
- writer.Write(m_CSC_IsFirstWhistle);
- writer.Write(m_CSC_IsFirstSheepClick);
- writer.Write(m_RGIR_Direction);
- writer.Write(m_NCS_IsSecondTime);
- writer.Write(m_NCS_IsCarryInScene);
- writer.Write(m_NCS_IsFirstClickRainbow);
- writer.Write(m_NCS_IsFirstClickCarry);
- writer.Write(m_NCS_IsFirstTimeWithWagon);
- writer.Write(m_IH_GameState);
- writer.Write(m_IH_ReEntryCount);
- writer.Write(m_IH_IsFirstFromRaingearThrowingMachine);
- writer.Write(m_RTM_VisitCount);
- writer.Write(m_RTM_UsedCatapultCount);
- writer.Write(m_RTM_IsFluffySleeping);
- writer.Write(m_RTM_IsCatapultReady);
- writer.Write(m_RTM_IsFirstSandwich);
- writer.Write(m_RH_GameState);
- writer.Write(m_RH_IsFirstTimeFromRainbow);
- writer.Write(m_RH_DidTalkToRockHead);
- writer.Write(m_RH_RockClickCount);
- writer.Write(m_CNAG_GameState);
- writer.Write(m_CNAG_DidSaySS4Speech);
- writer.Write(m_CNAG_DidSayAct4Speech);
- writer.Write(m_CNAG_IsFirstEditSpeech);
- writer.Write(m_CNAG_IsFromSample);
- writer.Write(m_CNAG_VisitCount);
- writer.Write(m_AAG_NextClickCount);
- writer.Write(m_AAG_PaigeClicked);
- writer.Write(m_AAG_Enter1Count);
- writer.Write(m_AAG_Enter2Count);
- writer.Write(m_AAG_Enter3Count);
- writer.Write(m_AAG_PaintUsed);
- writer.Write(m_AAG_EraseUsed);
- writer.Write(m_AAG_StampUsed);
- writer.Write(m_AAG_FillUsed);
- writer.Write(m_AAG_framePath); //mycode --rafael
- writer.Write(m_AAG_BombUsed);
- writer.Write(m_AAG_TwoPagesUsed);
- writer.Write(m_AAG_PlayUsed);
- writer.Write(m_RFM_RoundsCompleted);
- writer.Write(m_FP_GameState);
- writer.Write(m_FP_WagonHere);
- writer.Write((int)m_MapOpenedType);
- writer.Save(false); // false means we are not using tags, since we are saving data sequentially.
- }
- /*
- ES2.Save(m_PlayerName, m_PlayerName + ".dat?tag=pl");
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- ES2.Save((int)m_Items[i], m_PlayerName + ".dat?tag=it" + i);
- ES2.Save(m_SandwichCount, m_PlayerName + ".dat?tag=sa");
- ES2.Save(m_RedMarbleCount, m_PlayerName + ".dat?tag=re");
- ES2.Save(m_OrangeMarbleCount, m_PlayerName + ".dat?tag=or");
- ES2.Save(m_YellowMarbleCount, m_PlayerName + ".dat?tag=ye");
- ES2.Save(m_GreenMarbleCount, m_PlayerName + ".dat?tag=gr");
- ES2.Save(m_BlueMarbleCount, m_PlayerName + ".dat?tag=bl");
- for (int i = 0; i < (int)Location.Quantity; ++i)
- ES2.Save(m_Visited[i], m_PlayerName + ".dat?tag=vi" + i);
- ES2.Save((int)m_CurrentLocation, m_PlayerName + ".dat?tag=cu");
- ES2.Save(m_IsCloudVisible, m_PlayerName + ".dat?tag=is");
- for (int i = 0; i < (int)Location.Quantity; ++i)
- ES2.Save(m_Blocked[i], m_PlayerName + ".dat?tag=bl" + i);
- */
- }
- //================================================================================
- //
- //================================================================================
- public void SaveImage(Texture2D image, string name)
- {
- if (m_IsPracticeMode || image == null)
- {
- return;
- }
- string path = Application.persistentDataPath + "/" + m_PlayerName + "/" + name + ".png";
-
- using(ES2Writer writer = ES2Writer.Create(path))
- {
- writer.WriteRaw(image.EncodeToPNG());
- writer.Save(false);
- }
- }
-
- //================================================================================
- //
- //================================================================================
- public Texture2D LoadImage(string name, Vector2 size)
- {
- if (m_IsPracticeMode)
- {
- return null;
- }
-
- string path = Application.persistentDataPath + "/" + m_PlayerName + "/" + name + ".png";
-
- try
- {
- using(ES2Reader reader = ES2Reader.Create(path))
- {
- byte[] bytes = reader.ReadRaw();
- if (bytes.Length > 0)
- {
- Texture2D newTexture = new Texture2D((int)size.x, (int)size.y);
- newTexture.LoadImage(bytes);
- return newTexture;
- }
- }
- }
- catch(System.Exception e)
- {
- KishiTechUnity.KishiTechDebug.KTDebug.Instance().Log(e.Message);
- }
-
- return null;
- }
- //================================================================================
- //
- //================================================================================
- public int GetUsedRedMarbleCount()
- {
- return m_UsedRedMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void IncUsedRedMarbleCount()
- {
- ++m_UsedRedMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void DecUsedRedMarbleCount()
- {
- --m_UsedRedMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public int GetUsedYellowMarbleCount()
- {
- return m_UsedYellowMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void IncUsedYellowMarbleCount()
- {
- ++m_UsedYellowMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void DecUsedYellowMarbleCount()
- {
- --m_UsedYellowMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public int GetUsedBlueMarbleCount()
- {
- return m_UsedBlueMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void IncUsedBlueMarbleCount()
- {
- ++m_UsedBlueMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void DecUsedBlueMarbleCount()
- {
- --m_UsedBlueMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public int GetUsedGreenMarbleCount()
- {
- return m_UsedGreenMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void IncUsedGreenMarbleCount()
- {
- ++m_UsedGreenMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void DecUsedGreenMarbleCount()
- {
- --m_UsedGreenMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public int GetUsedOrangeMarbleCount()
- {
- return m_UsedOrangeMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void IncUsedOrangeMarbleCount()
- {
- ++m_UsedOrangeMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void DecUsedOrangeMarbleCount()
- {
- --m_UsedOrangeMarbleCount;
- }
- //================================================================================
- //
- //================================================================================
- public void CheatAllItemsInInventory()
- {
- for (int i = 0; i < (int)ItemEnum.Quantity; ++i)
- m_Items[i] = ItemState.Inventory;
- }
- } // public class PlayerData
- } // namespace ReaderRabbit
|