Exemplo n.º 1
0
    //Health system


    //--------------------------------------------------------------//
    //  ----------------Used for initialization---------------------//
    //--------------------------------------------------------------//
    void Start()
    {
        enemyState = state.idle;
        //pulling rooms value of entry or exit
        player       = GameObject.FindGameObjectWithTag("Player");
        trigger      = GameObject.FindGameObjectWithTag("Room").GetComponent <RoomTrigger>();
        playerScript = player.GetComponent <PlayerController2D>();
        // grabbing players rigidbody
        playerRigidBody = player.GetComponent <Rigidbody2D>();
        em = GetComponent <Rigidbody2D>();

        //Declares where to return to when not present
        startpos = new Vector3(em.position.x, em.position.y);
        Debug.Log(playerScript.getHealth());
    }