Beispiel #1
0
 public void LifeChange()
 {
     hitPoints -= 1;
     if (hitPoints == 0)
     {
         if (gameObject.tag == "Boss")
         {
             Destroy(gameObject);
         }
         hitPoints = 3;
         if (respawn != null)
         {
             respawn.RespawnPlayer();
         }
     }
 }
Beispiel #2
0
    void DisableRagDoll()
    {
        if (!anim.enabled)
        {
            anim.SetBool("isRagDoll", false);
//			Physics.IgnoreLayerCollision (8, 9, false);

            transform.position = GameObject.Find("mixamorig:Hips").transform.position;

            foreach (Rigidbody rb in player.GetComponentsInChildren <Rigidbody>())
            {
                rb.isKinematic = false;
                if (rb.name == "mixamorig:Hips")
                {
                    rb.constraints = RigidbodyConstraints.None;
                }

//				rb.detectCollisions = false;
//				if (rb.GetComponent<CapsuleCollider> ()) {
//					rb.GetComponent<CapsuleCollider> ().enabled = true;
//				}
            }

//			player.GetComponent<Rigidbody> ().isKinematic = false;
//			characterController.enabled = true;
            anim.enabled = true;

            reSpawn.RespawnPlayer();
//			player.GetComponent<Rigidbody> ().isKinematic = false;
        }
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        Respawn respawnScript = (Respawn)target;

        if (GUILayout.Button("Respawn player"))
        {
            respawnScript.RespawnPlayer();
        }
    }
 public void RestartFromLastCheckpoint()
 {
     if (Time.timeScale < 1)
     {
         Time.timeScale = 1;
         dof.active     = false;
     }
     endGamePopup.SetActive(false);
     gameHasEnded = false;
     // TODO: Implementar checkpoints
     respawn.RespawnPlayer();
 }
Beispiel #5
0
    public void afterdeath()
    {
        if (ScoreTracker.instance != null)
        {
            ScoreTracker.instance.deaths++;
        }
        attack         = false;
        boxCol.enabled = false;
        dancing        = false;
        anim.SetBool("dance", false);
        anim.SetBool("dance2", false);
        anim.SetBool("dance3", false);
        dash = false;

        respawn.RespawnPlayer();
        life = 10;
        anim.Play("respawn");
    }
Beispiel #6
0
 private void CallRespawn()
 {
     respawn.RespawnPlayer();
     ragdolled = false;
 }