/// <summary> /// Unity的等待事件,单位秒; /// </summary> /// <param name="waitTime"></param> /// <param name="actionName"></param> /// <returns></returns> public static bool OnWaitSecond(string waitTime, string actionName = null, string parameters = null) { float time = CastString.CastToNumbers <float>(waitTime)[0]; if (string.IsNullOrEmpty(parameters)) { UnityEventService.OnWaitSecond(time, EventFunctionLibrary.GetAction(actionName)); } else { UnityEventService.OnWaitSecond(time, EventFunctionLibrary.GetActionT(actionName), parameters); } return(true); }
/// <summary> /// 返回从一个物体发出的射线所击中的点;注意:若没有击中任何物体,返回(0,0,0); /// </summary> /// <param name="gameObject_Ray"></param> /// <param name="direction"></param> /// <returns></returns> public static Vector3 RayHitPoint(this GameObject gameObject_Ray, Vector3 direction) { return(UnityEventService.RayHitPoint(gameObject_Ray, direction)); }
/// <summary> /// 判断从一个物体发出的射线是否击中另一个指定的物体; /// </summary> /// <param name="gameObject_Ray"></param> /// <param name="gameObject_collider"></param> /// <param name="direction"></param> /// <returns></returns> public static bool RayHit(this GameObject gameObject_Ray, GameObject gameObject_collider, Vector3 direction) { return(UnityEventService.RayHit(gameObject_Ray, gameObject_collider, direction)); }
/// <summary> /// 判断一个物体是否被射线击中; /// </summary> /// <param name="gameObject"></param> /// <returns></returns> public static bool RayHited(this GameObject gameObject) { return(gameObject == UnityEventService.RayHit()); }