public void Respawn(bool resetHealth, bool useCheckpoint) { if (resetHealth) { damageable.SetHealth(damageable.startingHealth); } //we reset the hurt trigger, as we don't want the player to go back to hurt animation once respawned m_Animator.ResetTrigger(m_HashHurtPara); if (m_FlickerCoroutine != null) {//we stop flcikering for the same reason StopFlickering(); } m_Animator.SetTrigger(m_HashRespawnPara); if (useCheckpoint && m_LastCheckpoint != null) { UpdateFacing(m_LastCheckpoint.respawnFacingLeft); GameObjectTeleporter.Teleport(gameObject, m_LastCheckpoint.transform.position); } else { UpdateFacing(m_StartingFacingLeft); GameObjectTeleporter.Teleport(gameObject, m_StartingPosition); } }
public void Respawn(bool resetHealth, bool useCheckpoint) { Status status = GetComponent <Status>(); if (resetHealth) { //PersistentDataManager.LoadAllData(); //status.LoadData(); //GetComponent<Status>().SetHealth(damageable.startingHealth); status.HP = status.MaxHP; } //we reset the hurt trigger, as we don't want the player to go back to hurt animation once respawned m_Animator.ResetTrigger(m_HashHurtPara); if (m_FlickerCoroutine != null) {//we stop flcikering for the same reason StopFlickering(); } m_Animator.SetTrigger(m_HashRespawnPara); if (useCheckpoint && m_LastCheckpoint != null) { UpdateFacing(m_LastCheckpoint.respawnFacingLeft); GameObjectTeleporter.Teleport(gameObject, m_LastCheckpoint.transform.position); } else { UpdateFacing(m_StartingFacingLeft); GameObjectTeleporter.Teleport(gameObject, m_StartingPosition); } }
protected void TransitionInternal() { if (requiresInventoryCheck) { //if(!inventoryCheck.CheckInventory (inventoryController)) // return; } if (transitionType == TransitionType.SameScene) { GameObjectTeleporter.Teleport(transitioningGameObject, destinationTransform.transform); } else { //SceneController.TransitionToScene (this); } }
//es llamado por el ontrigger u interact pressed protected void TransitionInternal() { // requiere llave? si no ejecute las dos opciones abajo (mismo lugar o nueva escena) if (requiresInventoryCheck) { //Lista de chequeo? if (!inventoryCheck.CheckInventory(inventoryController)) { return; } } //Si escogi en la misma escena hagame un teleporter if (transitionType == TransitionType.SameScene) // misma escena { GameObjectTeleporter.Teleport(transitioningGameObject, destinationTransform.transform); //metodo estatico, creo me lleva a un T2 en GameObjectTeleporter... } else //si voy a otra escena llevele esta mismo script escena { SceneController.TransitionToScene(this); //metodo estatico de SceneController para cambiar de escena, llevele este script } }
public void ResetPosition() { GameObjectTeleporter.Teleport(resettingGameObject, transform); }