using System.Collections; using System.Collections.Generic; using UnityEngine; public static class UnityExpandFunction { /// /// ¼ì²â¶¯»­±êÇ© /// /// /// /// /// public static bool CheckAnimationTag(this Animator animator, string tagName, int animationIndex = 0) { return animator.GetCurrentAnimatorStateInfo(animationIndex).IsTag(tagName); } /// /// ¼ì²â¶¯»­Æ¬¶ÎÃû³Æ /// /// /// /// /// public static bool CheckAnimationName(this Animator animator, string animationName, int animationIndex = 0) { return animator.GetCurrentAnimatorStateInfo(animationIndex).IsName(animationName); } /// /// ±´Èû¶ûÇúÏß /// /// /// /// /// /// public static Vector2 Bezier(float t, Vector2 a, Vector2 b, Vector2 c) { var ab = Vector2.Lerp(a, b, t); var bc = Vector2.Lerp(b, c, t); return Vector2.Lerp(ab, bc, t); } public static CameraVR GetCamera() { return GameObject.FindWithTag("Camera").GetComponentInChildren(); } }