コード例 #1
0
    public AnimInfoBase(GameObject obj, object target, ParamType paramType, AnimType animType, float factor = 0.1f, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None, object initValue = null)
    {
        Object        = obj;
        Param         = paramType;
        Anim          = animType;
        Target        = target;
        initialValue_ = initValue;
        Factor        = factor;
        Delay         = delay;
        EndOption     = endOption;

        normalizedValue_ = 0;
        animValue_       = 0;

        if (Target is int)
        {
            int intTarget = (int)Target;
            Target = (float)intTarget;
        }

        if (Delay <= 0)
        {
            OnStartAnim();
        }
    }
コード例 #2
0
    public static void AddShakeAnim(Object obj, float range, float time, float updateTime, ParamType paramType, AnimType animType = AnimType.Time, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None)
    {
        GameObject gameObject = ToGameObject(obj);

        Instance.Animations.Add(new ShakeAnimInfo(gameObject, range, time, updateTime, paramType, animType, delay, endOption));
    }
コード例 #3
0
    public static void AddAnim(Object obj, object target, ParamType paramType, AnimType animType = AnimType.Linear, float timeFactor = 0.1f, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None, object initValue = null)
    {
        GameObject gameObject = ToGameObject(obj);

        switch (paramType)
        {
        case ParamType.Scale:
        case ParamType.ScaleX:
        case ParamType.ScaleY:
        case ParamType.ScaleZ:
        case ParamType.RotationZ:
        case ParamType.Position:
        case ParamType.PositionX:
        case ParamType.PositionY:
        case ParamType.PositionZ:
            Instance.Animations.Add(new TransformAnimInfo(gameObject, target, paramType, animType, timeFactor, delay, endOption, initValue));
            break;

        case ParamType.SizeDeltaX:
        case ParamType.SizeDeltaY:
        case ParamType.AnchoredPositionX:
        case ParamType.AnchoredPositionY:
            Instance.Animations.Add(new RectTransformAnimInfo(gameObject, target, paramType, animType, timeFactor, delay, endOption, initValue));
            break;

        case ParamType.PrimitiveRadius:
        case ParamType.PrimitiveWidth:
        case ParamType.PrimitiveArc:
            Instance.Animations.Add(new PrimitiveAnimInfo(gameObject, target, paramType, animType, timeFactor, delay, endOption, initValue));
            break;

        case ParamType.GaugeLength:
        case ParamType.GaugeRate:
        case ParamType.GaugeWidth:
            Instance.Animations.Add(new GaugeAnimInfo(gameObject, target, paramType, animType, timeFactor, delay, endOption, initValue));
            break;

        case ParamType.Color:
        case ParamType.AlphaColor:
            Instance.Animations.Add(new ColorAnimInfo(gameObject, target, paramType, animType, timeFactor, delay, endOption, initValue));
            break;

        case ParamType.TextColor:
        case ParamType.TextAlphaColor:
            Instance.Animations.Add(new TextAnimInfo(gameObject, target, paramType, animType, timeFactor, delay, endOption, initValue));
            break;

        case ParamType.Any:
            break;

        default:
            print("unknown anim type!");
            break;
        }
    }
コード例 #4
0
    public ShakeAnimInfo(GameObject obj, float range, float time, float updateTime, ParamType paramType, AnimType animType, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None)
        : base(obj, range, paramType, animType, time, delay, endOption)
    {
        if (paramType < ParamType.Position || ParamType.PositionZ < paramType)
        {
            throw new System.Exception("ShakeAnimInfo: wrong param type! paramType = " + paramType.ToString());
        }

        timer_      = 0;
        updateTime_ = updateTime;
    }
コード例 #5
0
 public TextAnimInfo(GameObject obj, object target, ParamType paramType, AnimType animType, float factor = 0.1f, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None, object initValue = null)
     : base(obj, target, paramType, animType, factor, delay, endOption, initValue)
 {
     if (paramType != ParamType.TextColor && paramType != ParamType.TextAlphaColor)
     {
         throw new System.Exception("TextAnimInfo: wrong param type! paramType = " + paramType.ToString());
     }
 }
コード例 #6
0
 public GaugeAnimInfo(GameObject obj, object target, ParamType paramType, AnimType animType, float factor = 0.1f, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None, object initValue = null)
     : base(obj, target, paramType, animType, factor, delay, endOption, initValue)
 {
     if (paramType < ParamType.GaugeLength || ParamType.GaugeWidth < paramType)
     {
         throw new System.Exception("GaugeAnimInfo: wrong param type! paramType = " + paramType.ToString());
     }
 }
コード例 #7
0
 public RectTransformAnimInfo(GameObject obj, object target, ParamType paramType, AnimType animType, float factor = 0.1f, float delay = 0.0f, AnimEndOption endOption = AnimEndOption.None, object initValue = null)
     : base(obj, target, paramType, animType, factor, delay, endOption, initValue)
 {
     if (paramType < ParamType.SizeDeltaX || ParamType.AnchoredPositionY < paramType)
     {
         throw new System.Exception("RectTransformAnimInfo: wrong param type! paramType = " + paramType.ToString());
     }
 }