void inputControl() { activeCutscene = cutsceneBits [cutsceneCounter]; if (Input.GetKeyDown(KeyCode.Mouse0) && display == true) { if (cutsceneCounter < cutsceneBits.Length - 1) { cutsceneCounter++; } else { anyCutsceneDisplaying = false; Time.timeScale = 1; Analytics.CustomEvent("VerTutorial", new Dictionary <string, object> { { "paso", activeCutscene.Paso }, { "tiempo", Time.timeSinceLevelLoad } } ); print("paso: " + activeCutscene.Paso + " tiempo en que se realizo el paso: " + Time.timeSinceLevelLoad); Destroy(this.gameObject); } } }
//===================================================== private void OnEnable() { if (Application.isPlaying == false) { return; } // Ensure path nodes have been assigned for moving platform if (_pathNodes.Length <= 0 || _pathNodes[0] == null) { Debug.LogWarning("Platform has no path nodes assigned!"); return; } GameManager.Instance.PauseEvent += OnPauseEvent; // If no switches are attached then activate platform along path if (_switches == null || _switches.Length <= 0) { switch (_type) { case ePlatformType.ON_PATH: FollowPath(); break; case ePlatformType.ON_SPLINE: FollowSpline(); break; } _isPlatformActivated = true; } else { // Set switch index and register with switch-activation events for (var i = 0; i < _switches.Length; i++) { if (_switches[i] == null) { continue; } _switches[i].Index = i; _switches[i].SwitchActivated += OnSwitchActivated; if (_switches[i].Type == eSwitchType.PRESSURE) { _switches[i].SwitchDeactivated += OnSwitchDeactivated; } } } // Platforms should have a parent container that may include a cutscene container _cutsceneContainer = _thisTransform.parent != null?_thisTransform.parent.GetComponentInChildren <CutsceneContainer>() : null; }
void inputControl() { activeCutscene = cutsceneBits [cutsceneCounter]; if (Input.GetKeyDown(KeyCode.Return)) { if (cutsceneCounter < cutsceneBits.Length - 1) { cutsceneCounter++; } else { anyCutsceneDisplaying = false; Time.timeScale = 1; Destroy(this.gameObject); } } }
//===================================================== protected virtual void OnEnable() { if (Application.isPlaying == false) { return; } // Disable collider if trigger is being manually triggered if (_isTriggeredExternally) { transform.GetComponent <Collider>().enabled = false; } // Get cutscene container _cutsceneContainer = transform.GetComponentInChildren <CutsceneContainer>(); if (_cutsceneContainer == null) { Debug.LogWarning("CutsceneTrigger: cutscene object is missing."); } }
//===================================================== protected virtual void OnEnable() { if (Application.isPlaying == false) { return; } GameManager.Instance.PauseEvent += OnPauseEvent; // Set audioSource clip and get cutscene container switch (_type) { case eCollectable.GEM: case eCollectable.HEALTH_GEM: _audioSource.clip = _clipGem; _cutsceneContainer = null; break; case eCollectable.RED_GEM: _audioSource.clip = _clipRedGem; _cutsceneContainer = null; break; case eCollectable.KEY: _audioSource.clip = _clipKey; // For non-double objects (doors) find the cutscene container as a child of the 'door' _cutsceneContainer = _thisTransform.GetComponentInChildren <CutsceneContainer>(); if (_cutsceneContainer == null) { // Otherwise, objects should have a parent that also includes a cutscene container _cutsceneContainer = (_thisTransform.parent != null) ? _thisTransform.parent.GetComponentInChildren <CutsceneContainer>() : null; } break; } // Set CurrentState switch (_type) { case eCollectable.GEM: ChangeState(eState.ACTIVE); break; case eCollectable.RED_GEM: ChangeState(eState.ACTIVE); break; case eCollectable.KEY: // Activate all keys except 100Gem and 8RedGem keys if (_keyId == ePuzzleKeyType.KEY_GEM_100 || _keyId == ePuzzleKeyType.KEY_GEM_RED) { ChangeState(eState.LOCKED); } else { ChangeState(eState.ACTIVE); } break; } // Place shadow in scene var layerMask = 1 << LayerMask.NameToLayer("Collidable") | 1 << LayerMask.NameToLayer("CollidableRaycast"); RaycastHit hit; if (Physics.Raycast(_thisTransform.position, Vector3.down, out hit, 100.0f, layerMask)) { _shadow.position = _thisTransform.position - new Vector3(0.0f, hit.distance - 0.05f, 0.0f); } }
//===================================================== void OnEnable() { if (Application.isPlaying == false) { return; } GameManager.Instance.PauseEvent += OnPauseEvent; if (_audioSource != null) { _audioSource.clip = _clipOpen; } if (_guiDoorInteraction != null) { _guiDoorInteraction.HideBubble(); } // Auto-open doors (that don't auto-close) if player has collected enough keys in the current location switch (_type) { case eDoorType.BASIC: case eDoorType.BASIC_DOUBLE: if (_autoClose == false && IsInteractionOk()) { OnPlayerInteraction(); } return; case eDoorType.PUZZLE_LOCKED: // Force puzzle locked door to not auto-close _autoClose = false; for (var i = 0; i < _switches.Length; i++) { if (_switches[i] == null) { continue; } _switches[i].Index = i; _switches[i].SwitchActivated += OnSwitchActivated; if (_switches[i].Type == eSwitchType.PRESSURE) { _switches[i].SwitchDeactivated += OnSwitchDeactivated; } } break; } // Get cutscene container if (_type == eDoorType.PUZZLE_LOCKED || _type == eDoorType.CRAWL || _type == eDoorType.OBLIVION_PORTAL || _type == eDoorType.PUZZLE_ENTRANCE || _type == eDoorType.PLAYER_HUB || _type == eDoorType.BOSS) { // For non-double doors find the cutscene container as a child of the 'door' _cutsceneContainer = _thisTransform.GetComponentInChildren <CutsceneContainer>(); if (_cutsceneContainer != null) { return; } // Otherwise, double doors should have a parent container that may include a cutscene container _cutsceneContainer = _thisTransform.parent != null?_thisTransform.parent.GetComponentInChildren <CutsceneContainer>() : null; } else { _cutsceneContainer = null; } }