Пример #1
0
        public static UCL_TweenerComponent Create(TC_Type iType)
        {
            UCL_TweenerComponent aTC = null;

            switch (iType)
            {
            case TC_Type.Move: {
                aTC = UCL_TC_Move.Create();
                break;
            }

            case TC_Type.Rotate: {
                aTC = UCL_TC_Rotate.Create();
                break;
            }

            case TC_Type.LookAt: {
                aTC = UCL_TC_LookAt.Create();
                break;
            }

            case TC_Type.Curve: {
                aTC = UCL_TC_Curve.Create();
                break;
            }

            case TC_Type.Action: {
                aTC = UCL_TC_Action.Create();
                break;
            }

            case TC_Type.Shake: {
                aTC = UCL_TC_Shake.Create();
                break;
            }

            case TC_Type.Scale: {
                aTC = UCL_TC_Scale.Create();
                break;
            }

            case TC_Type.Jump: {
                aTC = UCL_TC_Jump.Create();
                break;
            }

            case TC_Type.EulerRotation:
            {
                aTC = UCL_TC_EulerRotation.Create();
                break;
            }

            case TC_Type.Color:
            {
                aTC = UCL_TC_Color.Create();
                break;
            }

            case TC_Type.TweenerComponent: {
                aTC = new UCL_TweenerComponent();
                break;
            }

            case TC_Type.RectTransform:
            {
                aTC = UCL_TC_RectTransform.Create();
                break;
            }

            default: {
                string type_name = "UCL.TweenLib.UCL_TC_" + iType.ToString();
                Type   tc_type   = Type.GetType(type_name);
                if (tc_type != null)
                {
                    aTC = Activator.CreateInstance(tc_type) as UCL_TweenerComponent;
                }
                else
                {
                    Debug.LogError("type_name:" + type_name + ", not exist!!");
                }
                break;
            }
            }
            if (aTC == null)
            {
                aTC = new UCL_TweenerComponent();
            }
            return(aTC);
        }
Пример #2
0
 /// <summary>
 ///  Create a  TC_EulerRotation
 /// </summary>
 /// <param name="iTarget">Rotaion target</param>
 /// <param name="iX"></param>
 /// <param name="iY"></param>
 /// <param name="iZ"></param>
 /// <returns></returns>
 static public UCL_TC_EulerRotation TC_EulerRotation(this Transform iTarget, float iX, float iY, float iZ)
 {
     return(UCL_TC_EulerRotation.Create().Init(iTarget, iX, iY, iZ));
 }
Пример #3
0
 /// <summary>
 /// Create a  TC_EulerRotation
 /// </summary>
 /// <param name="iTarget"></param>
 /// <param name="iZ"></param>
 /// <returns></returns>
 static public UCL_TC_EulerRotation TC_RotateByZ(this Transform iTarget, float iZ)
 {
     return(UCL_TC_EulerRotation.Create().Init(iTarget, 0, 0, iZ));
 }
Пример #4
0
 /// <summary>
 /// Create a  TC_EulerRotation
 /// </summary>
 /// <param name="iTarget">Rotaion target</param>
 /// <param name="iRotation">rotaion euler angle</param>
 /// <returns></returns>
 static public UCL_TC_EulerRotation TC_EulerRotation(this Transform iTarget, Vector3 iRotation)
 {
     return(UCL_TC_EulerRotation.Create().Init(iTarget, iRotation));
 }