示例#1
0
        public static IEnumerator HapticPlayer(RagdollHand hand, AnimationCurve curve, float duration)
        {
            var time = Time.time;

            while (Time.time - time < duration)
            {
                hand.HapticTick(curve.Evaluate((Time.time - time) / duration));
                yield return(0);
            }
        }
示例#2
0
        public IEnumerator ScaleOverTime(RagdollHand hand = null)
        {
            float time = Time.time;

            while (Time.time - time < 0.2f)
            {
                float amount = Mathf.Clamp((Time.time - time) / 0.2f, 0, 1).MapOverCurve(
                    Tuple.Create(0f, 0f, 0f, 0f),
                    Tuple.Create(1f, 1f, 0f, 0f));
                item.transform.localScale = Vector3.one * amount;
                hand?.HapticTick(amount);
                yield return(0);
            }
            isFullySpawned = true;
        }