Ejemplo n.º 1
0
    /*---------------------------------------------------- LEVEL COMPLETE ----------------------------------------------------*/

    public void LevelComplete(LevelEndTeleporter levelEndTeleporter)
    {
        myPlayer.transform.FindChild("CollisionCheck").gameObject.layer = LayerMask.NameToLayer("PlayerNoCollision");

        myPlayer.GetComponent <PlayerControl>().enabled       = false;
        myPlayer.GetComponent <PhotonTransformView>().enabled = false;
        myPlayer.transform.FindChild("Player Animation").GetComponent <PhotonAnimatorView>().enabled = false;

        if (otherPlayer)
        {
            otherPlayer.transform.FindChild("CollisionCheck").gameObject.layer = LayerMask.NameToLayer("PlayerNoCollision");

            otherPlayer.GetComponent <PhotonTransformView>().enabled = false;
            otherPlayer.transform.FindChild("Player Animation").GetComponent <PhotonAnimatorView>().enabled = false;
        }

        StartCoroutine(levelEndTeleporter.LevelEndAnimation(myPlayer, otherPlayer));
    }
	/*---------------------------------------------------- LEVEL COMPLETE ----------------------------------------------------*/

    public void LevelComplete(LevelEndTeleporter levelEndTeleporter)
    {
        myPlayer.transform.FindChild("CollisionCheck").gameObject.layer = LayerMask.NameToLayer("PlayerNoCollision");

        myPlayer.GetComponent<PlayerControl>().enabled = false;
        myPlayer.GetComponent<PhotonTransformView>().enabled = false;
        myPlayer.transform.FindChild("Player Animation").GetComponent<PhotonAnimatorView>().enabled = false;

        if (otherPlayer)
        {
            otherPlayer.transform.FindChild("CollisionCheck").gameObject.layer = LayerMask.NameToLayer("PlayerNoCollision");

            otherPlayer.GetComponent<PhotonTransformView>().enabled = false;
            otherPlayer.transform.FindChild("Player Animation").GetComponent<PhotonAnimatorView>().enabled = false;
        }

        StartCoroutine(levelEndTeleporter.LevelEndAnimation(myPlayer, otherPlayer));
    }