void Awake()
    {
        //Set the current health to its' maximum health
        SetFullHealth();

        //Obtain the respawn script
        RespawnScript = GetComponent <TL_Respawn>();
    }
    void Awake()
    {
        //Find the player gameobject
        Player = GameObject.FindGameObjectWithTag("Player");

        //Set the starting position
        StartingPosition = Player.transform.position;

        //Obtain the respawn script
        RespawnScript = Player.GetComponent <TL_Respawn>();

        //Obtain the animation manager script form the player
        AnimationManagerScript = Player.GetComponent <TL_AnimationManager>();
    }
Ejemplo n.º 3
0
    void Start()
    {
        //Find the player
        PlayerCharacter = GameObject.FindGameObjectWithTag("Player");

        //Obtain the audio source
        CampfireAudio = GetComponent <AudioSource>();

        //Obtain the respawn script and the character health script from the player character
        RespawnScript = PlayerCharacter.GetComponent <TL_Respawn>();
        HealthScript  = PlayerCharacter.GetComponent <TL_CharacterHealth>();

        //Ignore the collisoin between the player character and this checkpoint
        Physics2D.IgnoreCollision(PlayerCharacter.GetComponent <BoxCollider2D>(), transform.GetComponent <BoxCollider2D>());
    }