public void UseMainSaving()
 {
     if (!IsMainSaving)
     {
         currentSaving = MainSaving;
         LoadFromInfo();
     }
 }
 public void ApplyMainSaving()
 {
     if (currentSaving != MainSaving)
     {
         currentSaving = MainSaving;
         LoadFromInfo();
         ApplySavingToPlayer();
     }
 }
Beispiel #3
0
    public override void OnPickup()
    {
        base.OnPickup();

        if (changeSpawnPoint >= 0 && !GameSaveManager.isLoading)
        {
            PlayerSaving.SetExitID(changeSpawnPoint);
            GameSaveManager.SaveRoom();
        }
    }
 public void UseAuxiliarySaving(string name)
 {
     if (_playerSavingList.ContainsKey(name))
     {
         _playerSavingList[name].Reset();
         currentSaving = _playerSavingList[name];
     }
     else
     {
         throw new SSCException($"不存在名字为 {name} 的辅助存档");
     }
 }
Beispiel #5
0
    void OnInteractStart(PlayerController source)
    {
        _Item item = source.inventory.equipped;

        if (item == null)
        {
            return;
        }
        if (item is _CoreItem)
        {
            return;
        }

        if (item.id == rodID && wheelInPlace)
        {
            // Place rod
            item.SendMessage(ItemMethods.OnItemDroppedOff, this, SendMessageOptions.DontRequireReceiver);
            Destroy(item.gameObject);

            rodRenderer.enabled = true;
            anim.SetBool("RodInPlace", true);
            electricPlayer.enabled = true;

            if (saveAfterItemAdded)
            {
                PlayerSaving.SetExitID(spawnPoint);
                StartCoroutine(GameSaveManager.SaveRoomWait());
            }
        }
        else if (item.id == wheelID && !wheelInPlace)
        {
            // Place wheel
            item.SendMessage(ItemMethods.OnItemDroppedOff, this, SendMessageOptions.DontRequireReceiver);
            Destroy(item.gameObject);

            wheelRenderer.enabled = true;

            if (saveAfterItemAdded)
            {
                PlayerSaving.SetExitID(spawnPoint);
                StartCoroutine(GameSaveManager.SaveRoomWait());
            }
        }
    }
 private void SetupPlayer()
 {
     Regions            = new List <Region>();
     MailList           = new List <Mail>();
     CurrentMatch       = null;
     curRegionName      = "";
     ShouldSyncDocument = true;
     MainSaving         = new PlayerSaving("Main");
     currentSaving      = MainSaving;
     OnAppendSaving?.Invoke(_playerSavingList);
     //for (int i = 0; i < bank2.item.Length; i++)
     //{
     //	bank2.item[i] = new Item();
     //}
     //for (int i = 0; i < bank3.item.Length; i++)
     //{
     //	bank3.item[i] = new Item();
     //}
 }
    void OnTriggerEnter(Collider col)
    {
        if (!works)
        {
            return;
        }

        GameObject main = col.GetMainObject();

        if (main.tag == "Player")
        {
            if (filter && PlayerController.instance.movement.autoMoveID != idMustBe)
            {
                return;
            }

            works = false;

            PlayerSaving.SetExitID(exitID);

            // Spawn loading screen
            GameSaveManager.SaveRoom();
            if (openCredits)
            {
                // Load with a delegate callback
                LoadingScreen.LoadRoom(gotoRoomOnTrigger, ls => {
                    // Loaded callback
                    var buttonActions = FindObjectOfType <ButtonActions>();
                    if (buttonActions)
                    {
                        buttonActions.OpenCreditsMenu();
                    }
                });
                BatteryGolemAnalytics.SendGameCompletedEvent();
            }
            else
            {
                // Load normally
                LoadingScreen.LoadRoom(gotoRoomOnTrigger);
            }
        }
    }