How to unlock mouse cursor?

I’m using the first person controller basic asset for a project I’m working on. Basically what I’m trying to make is a turn based battle system that locks the player movement, brings up the battle UI (the attack, defend, escape etc.) so far this is what I have.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;
using UnityEngine.UI;

public class BattleState : MonoBehaviour {
	private  IState state;

	public Canvas UI;

	private GameObject player;

	public GameObject battleUI;
	private bool isOn = false;

	void Start () 
		state = GetComponent<IState> ();

		player = GameObject.FindGameObjectWithTag("Player");

		battleUI = GameObject.Find("BattleUI");


	void Update () 
		if (state.inBattle) 
			// Do battle stuff

			Debug.Log ("Battle State");
			isOn = true;
			player.GetComponent <FirstPersonController> ().enabled = false;
			battleUI.SetActive (true);
			player.GetComponent<FirstPersonController> ().m_MouseLook.m_cursorIsLocked = false;




it makes the cursor visible and movable to click on each of the options. So far I’m able to make it visible in game, but it’s still locked.

Visit this link link text and comment me if anything goes wrong.