using System.Collections; using System.Collections.Generic; using UnityEngine; public class TargetAnimal : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public virtual void OnHit(Arrow arrow, Vector3 hitPoint, string partName) { } public float CalculateDistanceInHorizontal(Vector3 p1, Vector3 p2) { float deltaX = p2.x - p1.x; float deltaZ = p2.z - p1.z; return Mathf.Sqrt(deltaX * deltaX + deltaZ * deltaZ); } public void RandomRotate(float angle) { transform.forward = Quaternion.AngleAxis(angle, Vector3.up) * transform.forward; } }