Exemplo n.º 1
0
 public void Use()
 {
     SoundsController.Play("Correct");
     InventoryController.Instance.AddItem(item);
     Destroy(gameObject);
     IsActive = false;
 }
Exemplo n.º 2
0
 private void PlaceBlueKey()
 {
     SoundsController.Play("Correct");
     InventoryController.Instance.RemoveItem("i_key_blue");
     isBluePlaced = true;
     blueKeyObject.SetActive(true);
     Check();
 }
Exemplo n.º 3
0
 private void PlaceGreenKey()
 {
     SoundsController.Play("Correct");
     InventoryController.Instance.RemoveItem("i_key_green");
     isGreenPlaced = true;
     greenKeyObject.SetActive(true);
     Check();
 }
Exemplo n.º 4
0
 private void PlaceRedKey()
 {
     SoundsController.Play("Correct");
     InventoryController.Instance.RemoveItem("i_key_red");
     isRedPlaced = true;
     redKeyObject.SetActive(true);
     Check();
 }
Exemplo n.º 5
0
 // from inpector
 public void OnClickNumber(int num)
 {
     if (inputText.text.Length < 4)
     {
         inputText.text = inputText.text + num;
     }
     else
     {
         SoundsController.Play("Error");
     }
 }
Exemplo n.º 6
0
 private void OnEnterClick()
 {
     if (inputText.text == safe.password)
     {
         SoundsController.Play("Correct");
         safe.Unlock();
     }
     else
     {
         SoundsController.Play("Error");
         inputText.text = "";
     }
 }
Exemplo n.º 7
0
 public void Use()
 {
     if (isLocked)
     {
         SoundsController.Play("Error");
     }
     else
     {
         SoundsController.Play(soundId);
         isOpen = true;
         GetComponent <Collider>().enabled = false;
     }
 }
Exemplo n.º 8
0
 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();
     }
 }
Exemplo n.º 9
0
 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;
         }
     }
 }
Exemplo n.º 10
0
 public void OnCatchBattery()
 {
     SoundsController.Play("Correct");
     GameController.Instance.Values.restoredGenerators += 1;
     RefreshIndicators();
 }
Exemplo n.º 11
0
    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);
    }
Exemplo n.º 12
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     SoundsController.Play("ButtonHover");
 }
Exemplo n.º 13
0
 public void OnPointerClick(PointerEventData eventData)
 {
     SoundsController.Play("ButtonClick");
 }
Exemplo n.º 14
0
 public void AddItem(Item item)
 {
     SoundsController.Play("Equip");
     items.Add(item);
 }