public void Activate() { pawnStatus = PawnManager.ReadPawnStatus(); arcadeStatus = ArcadeManager.ReadArcadeStatus(); printers = new List <TicketPrinter>(); for (int i = 0; i < pawnStatus.Printers.Count; i++) { if (pawnStatus.Printers[i].IsActive) { printers.Add(pawnStatus.Printers[i]); ValidatePrinter(pawnStatus.Printers[i]); } } walletText.text = GameOperations.BigIntToString(pawnStatus.Money); UpdateFromReturn(); // Temp until Scroll for (int i = 0; i < ticketPrinterUIs.Count; i++) { ticketPrinterUIs[i].ActivePrinter = pawnStatus.Printers[i]; ticketPrinterUIs[i].Populate(); } gameObject.SetActive(true); buyPopUp.SetActive(false); upgradePopUp.SetActive(false); GetComponent <PrinterTrader>().CloseTradeInPopUp(); }
private void CreateCabinets() { arcadeStatus = ArcadeManager.ReadArcadeStatus(); arcadeCabinets = new List <ArcadeCabinet>(); if (arcadeStatus.DebugStatus.IsActive) { arcadeCabinets.Add(new ArcadeCabinet("The Debugger", "Sprites/CabinetScene/Placeholder/debugCabinet", cabinetMenus[0])); } if (arcadeStatus.QMGStatus.IsActive) { arcadeCabinets.Add(new ArcadeCabinet("???", "Sprites/CabinetScene/Placeholder/BlankCabinet", cabinetMenus[1])); } if (arcadeStatus.KNGStatus.IsActive) { arcadeCabinets.Add(new ArcadeCabinet("", "Sprites/CabinetScene/Placeholder/BananaQuest", cabinetMenus[2])); } if (arcadeStatus.BRDStatus.IsActive) { arcadeCabinets.Add(new ArcadeCabinet("", "Sprites/CabinetScene/Placeholder/WallysWorld", cabinetMenus[3])); } if (arcadeStatus.SNKStatus.IsActive) { arcadeCabinets.Add(new ArcadeCabinet("SNK", "Sprites/CabinetScene/Placeholder/BlankCabinet", cabinetMenus[4])); } }
void Awake() { if (Instance == null) { Instance = this; } if (Application.isEditor) { dataPath = Application.dataPath + "/../Arcade-Temp"; } else { dataPath = Application.dataPath + "/.."; } persistentDataPath = Application.persistentDataPath; fullArcadeVersionPath = persistentDataPath + "/Arcade_Data/" + arcadeInfoFileName + ".json"; if (File.Exists(fullArcadeVersionPath)) { arcadeVersion = Load(fullArcadeVersionPath); version.text = arcadeVersion.currentVersion.ToString(); } else { Save(); } }
public void Activate() { gameObject.SetActive(true); BigInteger prizeTickets = ArcadeManager.ReadArcadeStatus().ArcadePrizeStatus.Tickets; prizeText.text = GameOperations.BigIntToString(prizeTickets); }
public void Activate() { gameObject.SetActive(true); closePopUp(); pawnStatus = PawnManager.ReadPawnStatus(); arcadeStatus = ArcadeManager.ReadArcadeStatus(); moneyText.text = GameOperations.BigIntToString(pawnStatus.Money); }
public void Start() { //References Application.targetFrameRate = 60; arcadeManager = ArcadeManager.instance; levelStart += new LevelUpdate(StartLevel); }
void Awake() { arcadeManager = GameObject.FindObjectOfType <ArcadeManager>(); myTransform = transform.parent.transform; stateManager = GetComponentInChildren <StateManager>(); disappearer = GetComponent <Disappearer>(); animator = GetComponentInParent <Animator>(); locomotionController = GetComponent <CatchableLocomotionController>(); }
/** * Used to initialize the QMGShopController. */ public override void Initialize() { // read the file and initialize the CabinetStatus arcadeStatus = ArcadeManager.ReadArcadeStatus(); status = arcadeStatus.QMGStatus; UpdateTicketText(); currentSetIndex = 0; LoadUpgrades(currentSetIndex); }
void Awake() { SetupPaths(); arcadeManager = FindObjectOfType <ArcadeManager>(); if (arcadeManager == null) { UnityEngine.Debug.LogError("There is currently no 'ArcadeManager' in the scene"); UnityEngine.Debug.Break(); } settings = arcadeManager.autoUpdater; }
void MakeThisTheOnlyArcadeManager() { if (am == null) { DontDestroyOnLoad(gameObject); am = this; } else { if (am != this) { Destroy(gameObject); } } }
public void acceptTrade() { // get money pawnStatus.Money += moneyToReceive; moneyToReceive = 0; // reset layer 0 arcadeStatus.ResetButPreserve(); ArcadeManager.WriteArcadeStatus(); // re-init Activate(); // close popup closePopUp(); }
public void InitializePipe(ArcadeManager manager = null) { rb = GetComponent <Rigidbody2D>(); subPipes = GetComponentsInChildren <PipeCollisionDetector>(); foreach (PipeCollisionDetector subPipe in subPipes) { subPipe.manager = manager; } transform.position = rightLimit.position; //HEIGHT maxGapPercentage = minGapPercentage > maxGapPercentage ? minGapPercentage : maxGapPercentage; heightRange = upLimit.position.y - downLimit.position.y; minGapHeight = minGapPercentage * heightRange; maxGapHeight = maxGapPercentage * heightRange; }
private void Completed(object sender, AsyncCompletedEventArgs e) { if (e.Cancelled) { updateInfo.updateState = UpdateState.UPDATE_CANCELLED; print("Download has been canceled."); Directory.Delete(tempLocation, true); } else { updateInfo.updateState = UpdateState.UPDATE_FINISHED; ArcadeManager.UpdateCurrentVersion(); ArcadeManager.Save(); print("Download completed! Installing Updates..."); InstallUpdates(); } }
public void InitializeCurrencyView() { arcadeStatus = ArcadeManager.ReadArcadeStatus(); pawnStatus = PawnManager.ReadPawnStatus(); // Set the static currencies moneyText.text = GameOperations.BigIntToString(pawnStatus.Money); prizeTicketText.text = GameOperations.BigIntToString(arcadeStatus.ArcadePrizeStatus.Tickets); // Get the list of statuses to complete dynamic currencies int xPos = 0; int yPos = -10; int yOffset = -70; List <LayerZeroStatus> statuses = arcadeStatus.Statuses; lineItems = new List <GameObject>(); for (int i = 1; i < statuses.Count; i++) { CabinetStatus status = (CabinetStatus)statuses[i]; if (status.IsActive) { // Add prefab // Make the item GameObject lineItem = Instantiate(ticketLinePrefab); lineItem.transform.SetParent(scrollViewTransform, false); lineItems.Add(lineItem); // Set position RectTransform rt = lineItem.GetComponent <RectTransform>(); rt.anchorMin = new UnityEngine.Vector2(0, 0); rt.anchorMax = new UnityEngine.Vector2(1, 1); rt.sizeDelta = new Vector2(200, 50); rt.anchoredPosition = new UnityEngine.Vector3(xPos, yPos, 0); yPos += yOffset; //Populate the prefab with the proper data. lineItem.GetComponent <CurrencyViewUI>().Populate(status); } } int newHeight = Mathf.Max(-yPos, 720); scrollViewTransform.sizeDelta = new Vector2(225, newHeight); }
// Start is called before the first frame update void Awake() { arcadeStatus = ArcadeManager.ReadArcadeStatus(); SetWalletText(); incrementOneValue.image.color = defaultColor; incrementTenValue.image.color = defaultColor; incrementHundredValue.image.color = defaultColor; incrementFivePercent.image.color = defaultColor; incrementTwentyFivePercent.image.color = defaultColor; incrementMax.image.color = defaultColor; SelectButton(incrementOneValue); InitializeConversions(); convertPopUp.SetActive(false); prizeTicketsToReceive = 0; }
public void SaveGeneralConfiguration() { if (generalConfiguration.mainMenuArcadeConfiguration != mainMenuArcadeConfiguration.options[mainMenuArcadeConfiguration.value].text) { generalConfiguration.mainMenuArcadeConfiguration = mainMenuArcadeConfiguration.options[mainMenuArcadeConfiguration.value].text; FileManager.SaveJSONData <GeneralConfiguration>(generalConfiguration, Path.Combine(ArcadeManager.applicationPath + "/3darcade~/Configuration/"), "GeneralConfiguration.json"); // Now reset arcade and load this new one! GameObject arcadeObject = GameObject.Find("Arcade"); if (arcadeObject != null) { ArcadeManager arcadeManager = arcadeObject.GetComponent <ArcadeManager>(); if (arcadeManager != null) { arcadeManager.generalConfiguration = generalConfiguration; ArcadeManager.arcadeHistory.Clear(); ArcadeManager.loadSaveArcadeConfiguration.StartArcade(ArcadeManager.loadSaveArcadeConfiguration.GetArcadeConfigurationByID(generalConfiguration.mainMenuArcadeConfiguration), null); } } } }
/** The generic activity when a game is ended. */ public virtual void EndGame() { ArcadeManager.WriteArcadeStatus(); }
// Start is called before the first frame update public virtual void Start() { arcadeStatus = ArcadeManager.ReadArcadeStatus(); score = InitalScore; UpdateScore(); }
private void OnApplicationQuit() { ArcadeManager.WriteArcadeStatus(); PawnManager.RecordTimeStamp(); PawnManager.WritePawnStatus(); }
private void InitializeTicketDropDown() { ArcadeStatus arcadeStatus = ArcadeManager.ReadArcadeStatus(); ticketAssociations = new List <TicketAssociation>(); int index = 0; // add the none option TicketAssociation ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.None, "None", "Sprites/Currency/Tickets/NoTicket"); ticketAssociations.Add(ticketAssociation); index++; // cabinet tickets if (arcadeStatus.DebugStatus.IsActive) { ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.DebugTicket, "Debug Ticket", "Sprites/Currency/Tickets/DebugTicket"); ticketAssociations.Add(ticketAssociation); index++; } // ... // Copy the above for each cabinet ticket // ... if (arcadeStatus.QMGStatus.IsActive) { ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.QMGTicket, "Mystery Ticket", "Sprites/Currency/Tickets/QMGTicket"); ticketAssociations.Add(ticketAssociation); index++; } if (arcadeStatus.KNGStatus.IsActive) { ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.KNGTicket, "Banana Ticket", "Sprites/Currency/Tickets/KNGTicket"); ticketAssociations.Add(ticketAssociation); index++; } if (arcadeStatus.BRDStatus.IsActive) { ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.BRDTicket, "Magic Ticket", "Sprites/Currency/Tickets/BRDTicket"); ticketAssociations.Add(ticketAssociation); index++; } if (arcadeStatus.SNKStatus.IsActive) { ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.SNKTicket, "Snake Ticket", "Sprites/Currency/Tickets/SNKTicket"); ticketAssociations.Add(ticketAssociation); index++; } // prize tickets if (true) // figure out condition upon which players can print prize tickets { ticketAssociation = new TicketAssociation(index, TicketPrinter.TicketType.PrizeTicket, "Prize Ticket", "Sprites/Currency/Tickets/PrizeTicket"); ticketAssociations.Add(ticketAssociation); index++; } List <Dropdown.OptionData> options = new List <Dropdown.OptionData>(); TicketAssociation selection = null; for (int i = 0; i < ticketAssociations.Count; i++) { // construct options TicketAssociation curr = ticketAssociations[i]; options.Add(new Dropdown.OptionData(curr.label, GameOperations.LoadSpriteFromPath(curr.imagePath))); // find the one that matches our ticket type if (curr.ticketType == printer.Ticket) { selection = curr; } } // set the list of options ticketDropdown.options = options; // set to the current type ticketDropdown.SetValueWithoutNotify(selection.listIndex); ticketDropdown.RefreshShownValue(); }
// Start is called before the first frame update public void Awake() { instance = this; }