Пример #1
0
    private void SwapPlayerType(Player player)
    {
        PlayerTypes playerNewType = CharTypeInMe;
        PlayerTypes myNewType     = player.PlayerType();

        // Set Player's type!
        MyRoom.GameController.SetPlayerType(playerNewType);
        // Set/save my type!
        SetCharTypeInMe(myNewType);
        SaveStorage.SetString(SaveKeys.CharBarrelTypeInMe(MyRoom.MyRoomData, myIndex), myNewType.ToString());
        // Reset timeWhenCanSensePlayer!
        timeWhenCanSensePlayer = Time.time + 0.1f;
    }
Пример #2
0
    // ----------------------------------------------------------------
    //  Start
    // ----------------------------------------------------------------
    public void Initialize(Room _myRoom, CharBarrelData data, int myIndex)
    {
        base.InitializeAsProp(_myRoom, data);

        timeWhenCanSensePlayer = Time.time;

        this.otherCharName = data.otherCharName;
        this.myIndex       = myIndex;

        // Load what character's in me!
        string savedCharType = SaveStorage.GetString(SaveKeys.CharBarrelTypeInMe(MyRoom.MyRoomData, myIndex), otherCharName);

        SetCharTypeInMe(PlayerTypeHelper.TypeFromString(savedCharType));
    }
Пример #3
0
 public void ClearRoomSaveData(RoomData rd)
 {
     // Delete saved values!
     SaveStorage.DeleteKey(SaveKeys.HasPlayerBeenInRoom(rd));
     for (int i = 0; i < 9; i++) // Sloppy and inefficient!! But NBD for our purposes.
     {
         SaveStorage.DeleteKey(SaveKeys.DidEatGem(rd, i));
         SaveStorage.DeleteKey(SaveKeys.DidEatSnack(rd, i));
         SaveStorage.DeleteKey(SaveKeys.IsGateUnlocked(rd, i));
         SaveStorage.DeleteKey(SaveKeys.IsProgressGateOpen(rd, i));
         SaveStorage.DeleteKey(SaveKeys.IsVeilUnveiled(rd, i));
         SaveStorage.DeleteKey(SaveKeys.CharBarrelTypeInMe(rd, i));
     }
     // Recalculate SnackCountGame!
     if (rd.IsInCluster)
     {
         rd.MyCluster.RefreshSnackCount();
     }
     RefreshSnackCountGame();
 }