Esempio n. 1
0
        public static void StopParabola(Transform trans)
        {
            ParabolaUpdate parabola = trans.GetComponent <ParabolaUpdate>();

            if (parabola)
            {
                GameObject.DestroyImmediate(parabola);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 不加Time.deltaTime
        /// </summary>
        public static void Parabola(float delay, Transform trans, Vector3 toPos, float height, float delta, bool worldSpace, float elasticity, Action OnCollisionEvent, TweenEvent OnCollisionEventWithParam, Action OnEndEvent, TweenEvent OnEndEventWithParam)
        {
            ParabolaUpdate parabola = trans.GetComponent <ParabolaUpdate>();

            if (!parabola)
            {
                parabola = trans.gameObject.AddComponent <ParabolaUpdate>();
            }
            parabola.Go(delay, toPos, height, delta, worldSpace, elasticity, OnCollisionEvent, OnCollisionEventWithParam, OnEndEvent, OnEndEventWithParam);
        }