public void Use() { SoundsController.Play("Correct"); InventoryController.Instance.AddItem(item); Destroy(gameObject); IsActive = false; }
private void PlaceBlueKey() { SoundsController.Play("Correct"); InventoryController.Instance.RemoveItem("i_key_blue"); isBluePlaced = true; blueKeyObject.SetActive(true); Check(); }
private void PlaceGreenKey() { SoundsController.Play("Correct"); InventoryController.Instance.RemoveItem("i_key_green"); isGreenPlaced = true; greenKeyObject.SetActive(true); Check(); }
private void PlaceRedKey() { SoundsController.Play("Correct"); InventoryController.Instance.RemoveItem("i_key_red"); isRedPlaced = true; redKeyObject.SetActive(true); Check(); }
// from inpector public void OnClickNumber(int num) { if (inputText.text.Length < 4) { inputText.text = inputText.text + num; } else { SoundsController.Play("Error"); } }
private void OnEnterClick() { if (inputText.text == safe.password) { SoundsController.Play("Correct"); safe.Unlock(); } else { SoundsController.Play("Error"); inputText.text = ""; } }
public void Use() { if (isLocked) { SoundsController.Play("Error"); } else { SoundsController.Play(soundId); isOpen = true; GetComponent <Collider>().enabled = false; } }
public void Hit(int damage) { if (Health <= 0) { return; } Health -= damage; Health = Mathf.Max(0, Health); SoundsController.Play("Hit"); HitTime = Time.time; if (Health == 0) { Death(); } }
public void Use() { if (isLocked) { SoundsController.Play("Error"); } else { GameController.Instance.LoadLevel(locationName, true, null); SoundObject soundObject = SoundsController.Play(soundId); if (soundObject != null) { soundObject.dontDestroyOnLoad = true; } } }
public void OnCatchBattery() { SoundsController.Play("Correct"); GameController.Instance.Values.restoredGenerators += 1; RefreshIndicators(); }
private bool PerformActionForCurrentCell(Position position, Position direction) { var cell = Cells[position.r, position.c]; switch (cell.Type) { case CellType.Finish: { // won the game!! return(false); } case CellType.Door: { var doorGameObj = GetDoor(cell); var doorController = doorGameObj.GetComponent <DoorController>(); if (doorController.State == DoorState.Opened) { return(false); } break; } case CellType.Pickup: { cell.Type = CellType.Empty; _currentPuzzle.PickupCount--; for (int i = 0; i < _pickupsInSuperPuzzle.Length; i++) { if (_pickupsInSuperPuzzle[i] == cell.Position) { var superPuzzle = _puzzles[0][0, 0]; superPuzzle.PickupCount--; break; } } if (_currentPuzzle.PickupCount == 0) { ChangeCurrentDoorsStates(DoorState.Opened, true); Sounds.Play(SoundNames.Doors); } else { Sounds.Play(SoundNames.Pickup); } DestroyPickup(cell); break; } case CellType.Turn00: { if (direction == Position.Right) { Player.TurnLeft(); Player.UpdateDirection(); } else if (direction == Position.Down) { Player.TurnRight(); Player.UpdateDirection(); } Sounds.Play(SoundNames.Turn); break; } case CellType.Turn01: { if (direction == Position.Left) { Player.TurnRight(); Player.UpdateDirection(); } else if (direction == Position.Down) { Player.TurnLeft(); Player.UpdateDirection(); } Sounds.Play(SoundNames.Turn); break; } case CellType.Turn10: { if (direction == Position.Right) { Player.TurnRight(); Player.UpdateDirection(); } else if (direction == Position.Up) { Player.TurnLeft(); Player.UpdateDirection(); } Sounds.Play(SoundNames.Turn); break; } case CellType.Turn11: { if (direction == Position.Left) { Player.TurnLeft(); Player.UpdateDirection(); } else if (direction == Position.Up) { Player.TurnRight(); Player.UpdateDirection(); } Sounds.Play(SoundNames.Turn); break; } } return(true); }
public void OnPointerEnter(PointerEventData eventData) { SoundsController.Play("ButtonHover"); }
public void OnPointerClick(PointerEventData eventData) { SoundsController.Play("ButtonClick"); }
public void AddItem(Item item) { SoundsController.Play("Equip"); items.Add(item); }