Exemple #1
0
    void EraseEntry(int idx)
    {
        print("EraseEntry: " + idx);

        SaveEntryView v = GetEntryViewAtIndex(idx);

        if (v == null)
        {
            return;
        }

        bool success = SaveManager.Instance.DeleteGame(CursorIndex);

        if (success)
        {
            PlayDeleteSound();

            Destroy(v.gameObject);
            InstantiateSaveEntryView(CursorIndex);
            SetEntryViewsSelectedState(CursorIndex, true);
        }
        else
        {
            PlayErrorSound();
        }
    }
Exemple #2
0
    void SetEntryViewsSelectedState(int idx, bool value)
    {
        SaveEntryView v = GetEntryViewAtIndex(idx);

        if (v == null)
        {
            return;
        }

        v.UpdateSelectedState(value);
    }
Exemple #3
0
    void InstantiateSaveEntryView(int idx)
    {
        GameObject    g = Instantiate(saveEntryViewPrefab) as GameObject;
        SaveEntryView v = g.GetComponent <SaveEntryView>();

        Transform t = v.transform;

        t.SetParent(saveEntryViewsContainer);
        t.localPosition = new Vector3(0, -idx * entryHeight, -0.1f);
        t.localRotation = Quaternion.identity;

        v.InitWithEntryData(SaveManager.Instance.LoadEntryData(idx));

        _entryViews[idx] = v;
    }
Exemple #4
0
    void LoadEntry(int idx)
    {
        print("LoadEntry: " + idx);

        SaveEntryView v = GetEntryViewAtIndex(idx);

        if (v == null)
        {
            return;
        }

        CommonObjects.PlayerController_C.SetHaltUpdateMovement(false);

        Player p = CommonObjects.Player_C;

        p.RegisteredName = v.PlayerName;
        p.DeathCount     = v.PlayerDeathCount;

        SaveManager.Instance.LoadGame(idx);
    }