Esempio n. 1
0
    public void CloseCurrentWindow(bool bSpendTime = true, Constants.CallbackFunction callFunc = null, float spendingTurn = 1.0f, Constants.ClockImageType clockType = Constants.ClockImageType.HOUR_GLASS)
    {
        MasterManager.ManagerGlobalData.SavePlayerData();
        Panels[selectedIndex].SetActive(false);

        if (bSpendTime)
        {
            DayNightCycleManager.Instance.SpendTime(spendingTurn, callFunc, clockType);
        }

        UpdatePlayerUI();
    }
    private void EndExpectedTime()
    {
        Blocker.SetActive(false);
        ClockImage.SetActive(false);
        if (expectHandler != null)
        {
            expectHandler();
            expectHandler = null;
        }

        speedUp = false;
        speed   = 10;
    }
    public void SpendTime(float times, Constants.DayType day, int week, Constants.CallbackFunction callbackFunc = null, Constants.ClockImageType clockType = Constants.ClockImageType.HOUR_GLASS)
    {
        speed        *= speedMutiplier;
        speedUp       = true;
        expectingTime = times;
        expectingdDay = day;
        expectingWeek = week;

        expectHandler = callbackFunc;

        Blocker.SetActive(true);
        ClockImage.SetActive(true);
        ClockImage.GetComponent <Animator>().runtimeAnimatorController = imageAnimators[(byte)clockType];
    }
    public void SpendTime(float hourMultiPlier = 1.0f, Constants.CallbackFunction callbackFunc = null, Constants.ClockImageType clockType = Constants.ClockImageType.HOUR_GLASS)
    {
        float calcTime = envData.times + (Constants.HOUR_SPENT * hourMultiPlier * 3600f);

        Constants.DayType calcDay = envData.days;
        int calcWeek = envData.weeks;

        for (int count = 1; calcTime >= Constants.SECOND_FOR_DAY; ++count)
        {
            calcTime -= Constants.SECOND_FOR_DAY;
            calcDay   = envData.days + count;
            if (calcDay > Constants.DayType.SUNDAY)
            {
                calcDay  = 0;
                calcWeek = envData.weeks + 1;
            }
        }

        SpendTime(calcTime, calcDay, calcWeek, callbackFunc, clockType);
    }
Esempio n. 5
0
 public void ShowMessageBox(string title, string content, Constants.PopupType type, Constants.CallbackFunction func)
 {
     SetUpData(title, content, type);
     handler = func;
 }
Esempio n. 6
0
 public void ShowMessageBox(string title, string content, Constants.PopupType type, Constants.CallbackFunction func = null)
 {
     popupWindow = Instantiate(popupPrefabs);
     popupWindow.GetComponent <PopUp>().ShowMessageBox(title, content, type, func);
 }