private void GamePaused() { _laserPointer.SetActive(true); if (_audio != null) { _audio.volume = _minVolume; } _pausedGame.Raise(true); foreach (Collider collider in _canvasColliders) { collider.enabled = true; } _countingDown.Value = false; _startedWcPuzzle.Value = false; for (int i = 0; i < _teleport.Length; i++) { _teleport[i].enabled = false; } for (int j = 0; j < _interactable.Length; j++) { _interactable[j].enabled = false; } _pauseMenuCs.enabled = true; }
private void HandleHeroSelection() { if (Input.GetMouseButtonDown(0)) { hit = DetectHit(Input.mousePosition); } else if (Input.GetMouseButtonUp(0)) { if (hit.collider == null && isHeroSelected) // Action to unselect { clickCounter++; if (clickCounter == 1 && isCoroutineAllowedSelection) { firstClickTime = Time.time; StartCoroutine(HeroUnselection()); } } else if (hit.collider == heroColider) // Action to select { isHeroSelected = true; heroSelectEvent.Raise(isHeroSelected); Debug.Log("Hero Selected!"); } } }
public void CheckForNeighborHolding(Vector2 neighborPos) { if (neighborPos == -Vector2.one) { sendNeighborHoldingEvent.Raise(false); } else { // Checks if holder in given grid position is holding a bucket sendNeighborHoldingEvent.Raise(grid.gridArray[(int)neighborPos.x, (int)neighborPos.y].GetComponent <Holder>().isHoldingBucket); } }
public void PlaceObject() { // Place objects on AR plane if (hits.Count > 0 || Input.GetKey(KeyCode.Space)) { // placedObjects = FindObjectsOfType<PlacementObject>(); //ChangeSelectedObject(lastSelectedObject); // lastSelectedObject.oriScale = lastSelectedObject.transform.localScale; ChangeSelectedObject(Instantiate(placePrefab, placementPose.position, placementPose.rotation).GetComponent <PlacementObject>()); Debug.Log("Place instantiated"); onObjectPrefabSelectedEvent.Raise(false); } }
public void RemoveKey() { if (_unlocked || _paused) { return; } if (_currentInput.Value.Length > 0) { PlayClip(_removeClip); _currentInput.Value = _currentInput.Value.Remove(_currentInput.Value.Length - 1); } else { _attemptSuccesful.Raise(false); PlayClip(_incorrectClip); } _displayUpdate.Raise(); }
private void Update() { if (AllTargetsHit) { allTargetsHit.Value = true; } if (!_unlocked && allTargetsHit.Value) { finishedPuzzle.Raise(true); _unlocked = true; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); _invokeValue = EditorGUILayout.Toggle("Invoke value", _invokeValue); var buttonStyle = new GUIStyle(GUI.skin.button); buttonStyle.fontSize = 32; if (GUILayout.Button("Raise", buttonStyle, _buttonHeight)) { _target.Raise(_invokeValue); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); GUI.enabled = Application.isPlaying; BoolEvent e = target as BoolEvent; if (GUILayout.Button("Raise")) { e.Raise(e.testRaiseData); } }
void ChangeSelectedObject(PlacementObject selected) { placedObjects = FindObjectsOfType <PlacementObject>(); foreach (PlacementObject cur in placedObjects) { MeshRenderer meshRenderer = cur.GetComponent <MeshRenderer>(); if (selected != cur) { cur.IsSelected = false; // meshRenderer.material.color = inactiveColor; cur.GetComponent <Outline>().enabled = false; } else { lastSelectedObject = cur; cur.IsSelected = true; // meshRenderer.material.color = activeColor; cur.GetComponent <Outline>().enabled = true; placementObjectEvent.Raise(cur); onObjectSelected.Raise(true); } } // uIManager.UpdateUIAccordingToSelectedObject(); }
void CheckCollisions() { //Use the OverlapBox to detect if there are any other colliders within this box area. Collider[] hitColliders = Physics.OverlapBox(gameObject.transform.position, boxSize / 2, Quaternion.identity, cranePuzzleLayers); int gapCollidersHit = 0; foreach (Collider col in hitColliders) { gapCollidersHit++; } // If colliding with both sides trigger the puzzle completed event if (gapCollidersHit == 2 && !_triggered) { _triggered = true; _cranePuzzleCompleted.Raise(true); } }
public void DoAction() { onPickup.Raise(true); actionEvent.Raise(null); Destroy(gameObject); }
private void ToggleMenu() { _menuOpen.Toggle(); _pauseToggleEvent.Raise(_menuOpen.Value); }
public void RiseOnChange() { onChange?.Raise(Value); m_CurrentValue = Value; }
public void ToggleMute() { IsMuted = !IsMuted; AudioToggleEvent.Raise(IsMuted); }
protected override void Triggered(Component other) { base.Triggered(other); Event.Raise(Random.value > 0.5f, Key); }
private void OnTriggerEnter2D(Collider2D collision) { winEvent.Raise(true); }
public void SetVisible(bool visible) { roomChange.Raise(visible); }