Пример #1
0
    protected override void OnOpen()
    {
        SlotInfo.ClearCurrentSlotLoaded();
        ((UserSlotData)UserData.instance).SetSlot(-1, false);
        SceneState.instance.SetGlobalValue(LevelController.timeTrialKey, 0, false);

        bool hasCleared = false;

        ModalSaveSlots modalSlots = UIModalManager.instance.ModalGetController <ModalSaveSlots>("slots");

        for (int i = 0; i < modalSlots.slots.Length; i++)
        {
            if (SlotInfo.HasClearTime(i))
            {
                hasCleared = true;
                break;
            }
        }

        if (hasCleared)
        {
            activeGOCleared.SetActive(true);
        }
        else
        {
            activeGODefault.SetActive(true);
        }
    }
Пример #2
0
    public void RefreshClearTime()
    {
        string text = SlotInfo.GetClearTimeString(UserSlotData.currentSlot);

        label.text = string.Format(GameLocalize.GetText("cleartime"), text);

        if (SlotInfo.HasClearTime(UserSlotData.currentSlot))
        {
            if (SlotInfo.gameMode == SlotInfo.GameMode.Hardcore)
            {
                Leaderboard.instance.PostScore("Clear Time Iron Maiden", text, Mathf.RoundToInt(SlotInfo.GetClearTime(UserSlotData.currentSlot) * 1000.0f));
            }
            else if (SlotInfo.gameMode == SlotInfo.GameMode.Normal)
            {
                Leaderboard.instance.PostScore("Clear Time", text, Mathf.RoundToInt(SlotInfo.GetClearTime(UserSlotData.currentSlot) * 1000.0f));
            }
        }
    }