コード例 #1
0
    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();
    }
コード例 #2
0
    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]));
        }
    }
コード例 #3
0
    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();
        }
    }
コード例 #4
0
    public void Activate()
    {
        gameObject.SetActive(true);
        BigInteger prizeTickets = ArcadeManager.ReadArcadeStatus().ArcadePrizeStatus.Tickets;

        prizeText.text = GameOperations.BigIntToString(prizeTickets);
    }
コード例 #5
0
 public void Activate()
 {
     gameObject.SetActive(true);
     closePopUp();
     pawnStatus     = PawnManager.ReadPawnStatus();
     arcadeStatus   = ArcadeManager.ReadArcadeStatus();
     moneyText.text = GameOperations.BigIntToString(pawnStatus.Money);
 }
コード例 #6
0
    public void Start()
    {
        //References
        Application.targetFrameRate = 60;
        arcadeManager = ArcadeManager.instance;

        levelStart += new LevelUpdate(StartLevel);
    }
コード例 #7
0
 void Awake()
 {
     arcadeManager        = GameObject.FindObjectOfType <ArcadeManager>();
     myTransform          = transform.parent.transform;
     stateManager         = GetComponentInChildren <StateManager>();
     disappearer          = GetComponent <Disappearer>();
     animator             = GetComponentInParent <Animator>();
     locomotionController = GetComponent <CatchableLocomotionController>();
 }
コード例 #8
0
    /**
     * 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);
    }
コード例 #9
0
    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;
    }
コード例 #10
0
ファイル: ArcadeManager.cs プロジェクト: GroveJr/Brawlmania
 void MakeThisTheOnlyArcadeManager()
 {
     if (am == null)
     {
         DontDestroyOnLoad(gameObject);
         am = this;
     }
     else
     {
         if (am != this)
         {
             Destroy(gameObject);
         }
     }
 }
コード例 #11
0
    public void acceptTrade()
    {
        // get money
        pawnStatus.Money += moneyToReceive;
        moneyToReceive    = 0;

        // reset layer 0
        arcadeStatus.ResetButPreserve();
        ArcadeManager.WriteArcadeStatus();

        // re-init
        Activate();

        // close popup
        closePopUp();
    }
コード例 #12
0
    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;
    }
コード例 #13
0
 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();
     }
 }
コード例 #14
0
    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);
    }
コード例 #15
0
    // 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;
    }
コード例 #16
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);
             }
         }
     }
 }
コード例 #17
0
 /** The generic activity when a game is ended. */
 public virtual void EndGame()
 {
     ArcadeManager.WriteArcadeStatus();
 }
コード例 #18
0
 // Start is called before the first frame update
 public virtual void Start()
 {
     arcadeStatus = ArcadeManager.ReadArcadeStatus();
     score        = InitalScore;
     UpdateScore();
 }
コード例 #19
0
 private void OnApplicationQuit()
 {
     ArcadeManager.WriteArcadeStatus();
     PawnManager.RecordTimeStamp();
     PawnManager.WritePawnStatus();
 }
コード例 #20
0
    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();
    }
コード例 #21
0
 // Start is called before the first frame update
 public void Awake()
 {
     instance = this;
 }