// Use this for initialization
    void Start()
    {
        instance = this;

        GameManager.OnGameEnd += GameManager_OnGameEnd;
        endDayPanel.SetActive(false);
    }
Beispiel #2
0
 public static float CommitTransaction(Customer cust, GameType game)
 {
     if (!instance.mainMenuMode)
     {
         if (Logistics.GetStock(game) > 0)
         {
             //Success
             cust.CommitTransaction(true);
             float revenue = MarketManager.GetSalePrice(game);
             AdjustCash(revenue);
             EndDayManager.AddRevenue(game, revenue);
             Logistics.ExpendGame(game);
             return(revenue);
         }
         else
         {
             //Failure
             cust.CommitTransaction(false);
             return(0);
         }
     }
     else
     {
         cust.CommitTransaction(true);
         return(0);
     }
 }
Beispiel #3
0
    IEnumerator ProcessDayEnd()
    {
        DaytimeManager.PauseDaytime();
        if (Days > 0)
        {
            yield return(new WaitWhile(() => { return custCount > 0; }));

            if (selected != null)
            {
                DeselectAll();
            }
            stockAnimator.Play("Closed");

            gameFaderAnim.Play("FadeIn");
            yield return(new WaitForSeconds(1f));

            EndDayManager.ShowEndDayPanel();
            gameFaderAnim.Play("FadeOut");
        }
        else
        {
            stockAnimator.Play("Closed");
            EndDayManager.ShowEndDayPanel();
        }
    }
Beispiel #4
0
 public void OnFadeIn(int mode)
 {
     if (mode == 0)
     {
         EndDayManager.ShowStartDayPanel();
     }
     else if (mode == 1)
     {
     }
 }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        instance = this;
        print("GameManager instance change, Showcase mode is " + (instance.mainMenuMode ? "on" : "off"));

        if (!mainMenuMode)
        {
            GameLevel = 1;

            EndDayManager.AddExpense(ExpenseType.Maintenance, Departments.Start, maintenanceCost);

            Cash = startingMoney;

            rt.gestureRecognizedEvent += (i) =>
            {
                if (!EndDayManager.IsPanelOpen)
                {
                    cameraPivot.Rotate(Vector3.up, -rt.deltaRotation * rotateSensitivity, Space.World);
                }
            };

            pr.gestureRecognizedEvent += (i) =>
            {
                if (!EndDayManager.IsPanelOpen)
                {
                    Camera.main.transform.Translate(Vector3.forward * 2 * pr.deltaScale * pinchSensitivity);
                }
            };
            TouchKit.addGestureRecognizer(rt);
            TouchKit.addGestureRecognizer(pr);

            DaytimeManager.OnDayEnd += DaytimeManager_OnDayEnd;
            EventManager.RunStartEvent();

            gameFaderAnim.Play("FadeOut");
        }
    }
 private void GameManager_OnGameEnd()
 {
     instance = null;
     GameManager.OnGameEnd -= GameManager_OnGameEnd;
 }