private void Update() { if (Input.GetKeyDown(CreateKey)) { CreateObject(); } else if (Input.GetKeyDown(DestroyKey)) { DestroyObject(); } else if (Input.GetKeyDown(NewGameKey)) { StartNewGame(); } else if (Input.GetKeyDown(SaveGameKey)) { storage.Save(this, saveVersion); } else if (Input.GetKeyDown(LoadGameKey)) { storage.Load(this); } }
private void Update() { if (Input.GetKeyDown(createKey)) { CreateObject(); } if (Input.GetKeyDown(newGameKey)) { BeginNewGame(); } if (Input.GetKeyDown(saveKey)) { storage.Save(this, saveVersion); } if (Input.GetKeyDown(loadKey)) { BeginNewGame(); storage.Load(this); } }
void Update() { if (Input.GetKeyDown(createKey)) { CreateShape(); } else if (Input.GetKey(newGameKey)) { BeginNewGame(); } else if (Input.GetKeyDown(saveKey)) { storage.Save(this, saveVersion); } else if (Input.GetKeyDown(loadKey)) { BeginNewGame(); storage.Load(this); } else if (Input.GetKeyDown(destroyKey)) { DestroyShape(); } creationProgress += Time.deltaTime * CreationSpeed; while (creationProgress >= 1f) { creationProgress -= 1f; CreateShape(); } destructionProgress += Time.deltaTime * DestructionSpeed; while (destructionProgress >= 1f) { destructionProgress -= 1f; DestroyShape(); } }
private void Update() { if (Input.GetKeyDown(createKey)) { CreateShape(); } 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; } } } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(creatKey)) { GameLevel.Current.SpawnShape(); } else if (Input.GetKeyDown(destoryKey)) { DestoryShape(); } else if (Input.GetKeyDown(beginKey)) { 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.Keypad0 + i)) { BeginNewGame(); StartCoroutine(LoadLevel(i)); return; } } } }
void Update() { if (Input.GetKeyDown(createKey)) // Spawn objects into the currently selected level when createKey is pressed { GameLevel.Current.SpawnShapes(); } else if (Input.GetKeyDown(destroyKey)) // Prepare object for destruction when destroyKey is pressed { DestroyShape(); } else if (Input.GetKeyDown(newGameKey)) // Refresh game level when button is pressed { BeginNewGame(); StartCoroutine(LoadLevel(loadedLevelBuildIndex)); } else if (Input.GetKeyDown(saveKey)) // Save data in current level if button is pressed { storage.Save(this, saveVersion); } else if (Input.GetKeyDown(loadKey)) { BeginNewGame(); // Refresh game level, then load object data from save file storage.Load(this); } else { for (int i = 1; i <= levelCount; i++) // Checks through levels { if (Input.GetKeyDown(KeyCode.Alpha0 + i)) // Checks if a number button is pressed that corresponds to a level { BeginNewGame(); // Refresh scene and load a new level StartCoroutine(LoadLevel(i)); return; } } } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(createKey)) { //CreateShape(); GameLevel.Current.SpawnShapes(); } 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)); } } } }
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); } }
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); } }
private void Update() { if (Input.GetKeyDown(createKey)) { GameLevel.Current.SpawnShape(); } else if (Input.GetKeyDown(destroyKey)) { DestroyShape(); } else if (Input.GetKeyDown(newGameKey)) { BeginNewGame(); StartCoroutine(LoadLevel(loadedLevelBuildIndex)); } else if (Input.GetKeyDown(saveKey)) { storage.Save(this); } else if (Input.GetKeyDown(loadKey)) { storage.Load(this); } else { for (int i = 1; i != levelCount; ++i) { if (Input.GetKeyDown(KeyCode.Alpha0 + i)) { BeginNewGame(); StartCoroutine(LoadLevel(i)); return; } } } }
public void LoadGame() { storage.Load(this); }
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(); } }
private void LoadGame() { StartNewGame(); _storage.Load(this); }
public void Load() { BeginNewGame(); storage.Load(this); }