示例#1
0
        public static void StopSwing(Transform trans)
        {
            SwingUpdate swing = trans.GetComponent <SwingUpdate>();

            if (swing)
            {
                GameObject.DestroyImmediate(swing);
            }
        }
示例#2
0
        public static void Swing(float delay, Transform trans, float offsetAngle, float speed, float time, bool useDamping, Action endEvent, TweenEvent endEventWithParam)
        {
            SwingUpdate swing = trans.GetComponent <SwingUpdate>();

            if (!swing)
            {
                swing = trans.gameObject.AddComponent <SwingUpdate>();
            }
            swing.Swing(delay, offsetAngle, speed, time, useDamping, endEvent, endEventWithParam);
        }