Save() 공개 메소드

public Save ( PersistableObject, o ) : void
o PersistableObject,
리턴 void
예제 #1
0
    private void Update()
    {
        if (Input.GetKeyDown(createKey))
        {
            CreateShape();
        }
        else if (Input.GetKeyDown(destroyKey))
        {
            DestroyShape();
        }
        else if (Input.GetKey(newGameKey))
        {
            BeginNewGame();
        }
        else if (Input.GetKeyDown(saveKey))
        {
            storage.Save(this, saveVersion);
        }
        else if (Input.GetKeyDown(loadKey))
        {
            storage.Load(this);
        }

        creationProgress += Time.deltaTime * CreationSpeed;
        while (creationProgress >= 1.0f)
        {
            creationProgress -= 1.0f;
            CreateShape();
        }

        destructionprogress += Time.deltaTime * DestructionSpeed;
        while (destructionprogress >= 1f)
        {
            destructionprogress -= 1.0f;
            DestroyShape();
        }
    }
예제 #2
0
 private void Update()
 {
     if (Input.GetKeyDown(createKey))
     {
         CreateShape();
     }
     else if (Input.GetKeyDown(newGameKey))
     {
         BeginNewGame();
         StartCoroutine(LoadLevel(_loadedLevelIndex));
     }
     else if (Input.GetKeyDown(saveKey))
     {
         storage.Save(this, SAVE_VERSION);
     }
     else if (Input.GetKeyDown(loadKey))
     {
         BeginNewGame();
         storage.Load(this);
     }
     else if (Input.GetKeyDown(destroyKey))
     {
         DestroyShape();
     }
     else
     {
         for (int i = 1; i <= levelCount; i++)
         {
             if (Input.GetKeyDown(KeyCode.Alpha0 + i))
             {
                 BeginNewGame();
                 StartCoroutine(LoadLevel(i));
                 return;
             }
         }
     }
 }
예제 #3
0
 void Update()
 {
     if (Input.GetKeyDown(createKey))
     {
         GameLevel.Current.SpawnShapes();
     }
     else if (Input.GetKeyDown(destroyKey))
     {
         DestroyShape();
     }
     else if (Input.GetKeyDown(newGameKey))
     {
         BeginNewGame();
         StartCoroutine(LoadLevel(loadedLevelBuildIndex));
     }
     else if (Input.GetKeyDown(saveKey))
     {
         storage.Save(this, saveVersion);
     }
     else if (Input.GetKeyDown(loadKey))
     {
         BeginNewGame();
         storage.Load(this);
     }
     else
     {
         for (int i = 1; i <= levelCount; i++)
         {
             if (Input.GetKeyDown(KeyCode.Alpha0 + i))
             {
                 BeginNewGame();
                 StartCoroutine(LoadLevel(i));
                 return;
             }
         }
     }
 }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(createKey))
     {
         CreateShape();
     }
     else if (Input.GetKeyDown(destroyKey))
     {
         DestroyShape();
     }
     else if (Input.GetKey(newGameKey))
     {
         BeginNewGame();
         StartCoroutine(LoadLevel(loadedLevelBuildIndex));
     }
     else if (Input.GetKeyDown(saveKey))
     {
         storage.Save(this, saveVersion);
     }
     else if (Input.GetKeyDown(loadKey))
     {
         BeginNewGame();
         storage.Load(this);
     }
     else
     {
         for (int i = 0; i <= levelCount; ++i)
         {
             if (Input.GetKeyDown(KeyCode.Alpha0 + i))
             {
                 BeginNewGame();
                 StartCoroutine(LoadLevel(i));
             }
         }
     }
 }
예제 #5
0
 void Update()
 {
     if (Input.GetKey(createKey))
     {
         CreateShape();
     }
     if (Input.GetKey(destroyKey))
     {
         DestroyShape();
     }
     if (Input.GetKey(newGameKey))
     {
         BeginNewGame();
     }
     if (Input.GetKeyDown(saveKey))
     {
         storage.Save(this, saveVersion);
     }
     if (Input.GetKeyDown(loadKey))
     {
         BeginNewGame();
         storage.Load(this);
     }
     creationProgress    += Time.deltaTime * CreationSlider.value * 100f;
     destructionProgress += Time.deltaTime * DestructionSlider.value * 100f;
     if (creationProgress >= 1f)
     {
         creationProgress -= 1f;
         CreateShape();
     }
     if (destructionProgress >= 1f)
     {
         destructionProgress -= 1f;
         DestroyShape();
     }
 }
 private void Update()
 {
     //Creating new cubes on keyinput - c
     if (Input.GetKeyDown(createKey))
     {
         CreateObjects();
     }
     //starting a new game
     else if (Input.GetKeyDown(newGameKey))
     {
         BeginNewGame();
     }
     //saving the game
     else if (Input.GetKeyDown(saveKey))
     {
         storage.Save(this);
     }
     //loading form saved file
     else if (Input.GetKeyDown(loadKey))
     {
         BeginNewGame();
         storage.Load(this);
     }
 }
예제 #7
0
 private void Update()
 {
     if (Input.GetKey(createKey))
     {
         CreateShape();
     }
     else if (Input.GetKeyDown(destroyKey))
     {
         DestroyShape();
     }
     else if (Input.GetKeyDown(newGameKey))
     {
         BeginNewGame();
     }
     else if (Input.GetKeyDown(saveKey))
     {
         storage.Save(this, saveVersion);
     }
     else if (Input.GetKeyDown(loadKey))
     {
         BeginNewGame();
         storage.Load(this);
     }
 }
예제 #8
0
 protected void Save()
 {
     _storage.Save(_grid);
     PlayerPrefs.SetInt(PlayerPrefKeys.HasGameInProgress, _grid.IsEmpty ? 0 : 1);
     PlayerPrefs.Save();
 }
예제 #9
0
 public void HandleShipDestroy()
 {
     StopGame();
     PersistentStorage.Save(this);
 }
예제 #10
0
    private void FixedUpdate()
    {
        inGameUpdateLoop = true;

        for (int i = 0; i < shapes.Count; i++)
        {
            shapes[i].GameUpdate();
        }

        inGameUpdateLoop = false;

        #region KeyControls
        //куча ифов для кнопок
        if (Input.GetKey(createKey))
        {
            GameLevel.Current.SpawnShapes();
        }
        else if (Input.GetKey(destroyKey))
        {
            DestroyShape();
        }
        else if (Input.GetKeyDown(newGameKey))
        {
            BeginNewGame();
            StartCoroutine(LoadLevel(loadedLevelBuildIndex));
        }
        else if (Input.GetKeyDown(saveGameKey))
        {
            storage.Save(this, saveVersion);
        }
        else if (Input.GetKeyDown(loadGameKey))
        {
            BeginNewGame();
            storage.Load(this);
        }
        else
        {
            for (int i = 1; i <= levelCount; i++)
            {
                if (Input.GetKeyDown(KeyCode.Alpha0 + i))
                {
                    BeginNewGame();
                    StartCoroutine(LoadLevel(i));
                    return;
                }
            }
        }
        #endregion

        //Управление скоростью создания шейпов
        creationProgress += Time.deltaTime * CreationSpeed;

        while (creationProgress >= 1f)
        {
            creationProgress -= 1f;
            GameLevel.Current.SpawnShapes();
        }

        //управление скоростью разрушения шейпов
        destructionProgress += Time.deltaTime * DestructionSpeed;

        while (destructionProgress >= 1f)
        {
            destructionProgress -= 1f;
            DestroyShape();
        }

        int limit = GameLevel.Current.PopulationLimit;
        if (limit > 0)
        {
            while (shapes.Count - dyingShapeCount > limit)
            {
                DestroyShape();
            }
        }
        if (killList.Count > 0)
        {
            for (int i = 0; i < killList.Count; i++)
            {
                if (killList[i].IsValid)
                {
                    KillImmediately(killList[i].Shape);
                }
            }
            killList.Clear();
        }
        if (markAsDyingList.Count > 0)
        {
            for (int i = 0; i < markAsDyingList.Count; i++)
            {
                if (markAsDyingList[i].IsValid)
                {
                    MarkAsDyingImmediately(markAsDyingList[i].Shape);
                }
            }
            markAsDyingList.Clear();
        }
    }
예제 #11
0
 private void SaveGame()
 {
     _storage.Save(this);
 }
예제 #12
0
 public void Save()
 {
     storage.Save(this, SaveVersion);
 }