using UnityEngine;
using System.Collections;
public class MeleeSystem : MonoBehaviour
{
public int MinDamage = 25;
public int maxDamamge = 50;
public float weaponRange = 3.5f;
public Camera FPSCamera;
private void Update()
{
Ray ray = FPSCamera.ScreenPointToRay(new Vector2(Screen.width / 2, Screen.height / 2));
RaycastHit hitInfo;
if (Input.GetKeyDown(KeyCode.Mouse0))
{
if (Physics.Raycast(ray, out hitInfo, weaponRange))
{
if (hitInfo.collider.tag == "Tree")
{
TreeHealth = hitInfo.collider.GetComponentInParent<TreeHealth>();
AttackTree();
}
}
}
}
private void AttackTree()
{
}
}