コード例 #1
0
 public void LifeChange()
 {
     hitPoints -= 1;
     if (hitPoints == 0)
     {
         if (gameObject.tag == "Boss")
         {
             Destroy(gameObject);
         }
         hitPoints = 3;
         if (respawn != null)
         {
             respawn.RespawnPlayer();
         }
     }
 }
コード例 #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;
        }
    }
コード例 #3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        Respawn respawnScript = (Respawn)target;

        if (GUILayout.Button("Respawn player"))
        {
            respawnScript.RespawnPlayer();
        }
    }
コード例 #4
0
 public void RestartFromLastCheckpoint()
 {
     if (Time.timeScale < 1)
     {
         Time.timeScale = 1;
         dof.active     = false;
     }
     endGamePopup.SetActive(false);
     gameHasEnded = false;
     // TODO: Implementar checkpoints
     respawn.RespawnPlayer();
 }
コード例 #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");
    }
コード例 #6
0
 private void CallRespawn()
 {
     respawn.RespawnPlayer();
     ragdolled = false;
 }