SkillTree.checkTargetAction C# (CSharp) Method

checkTargetAction() protected method

protected checkTargetAction ( ) : void
return void
	protected void checkTargetAction(){
		//make sure target is set, and mouse is still in target position (since target doesn't go back null)
		if(target != null && target.position.Contains(mousePositionInSkillTree())){
			//on mouse click, if target skill is avalable BUT not unlocked
			if(Input.GetMouseButtonDown(0) && target.isAvailable() && !target.isUnlocked()){
				//if player has usable skill points
				if(player.usableSkillPoints > 0){
					target.makeUnlocked(); // may be useless remove if so
					unlockSkill(target);
				}
			}
		}
	}