Ejemplo n.º 1
0
 static public EZJointTween Begin(GameObject bone, GameObject joint, exSprite sprite, EZSkew skew, JsonSkeletalObj[] datas, float speed)
 {
     return(EZJointTween.Play(bone, joint, sprite, skew, datas, speed, 0, 0));
 }
Ejemplo n.º 2
0
    public static EZJointTween Play(GameObject bone, GameObject joint, exSprite sprite, EZSkew skew, JsonSkeletalObj[] datas, float speed, int n, float time)
    {
        int temp = 0;
        for(int m =0; m <n +1; ++m){
            temp += datas[m].d;
        }

        float duration = temp * speed - time;
        if(duration<0){
            duration = 0;
        }
        EZJointTween comp = EZTweener.Begin<EZJointTween>(joint, duration);

        comp.sprite_ = sprite;
        comp.skew_ = skew;
        comp._joint = joint;
        comp._bone = bone;
        comp._datas = datas;
        comp._speed = speed;
        comp._n = n;
        comp.setup();
        comp.onFinished = EZJointTween.OnFinished_;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            EZJointTween.OnFinished_(comp);
        }
        return comp;
    }
Ejemplo n.º 3
0
    static public EZJointTween Play(GameObject bone, GameObject joint, exSprite sprite, EZSkew skew, JsonSkeletalObj[] datas, float speed, int n, float time)
    {
        int temp = 0;

        for (int m = 0; m < n + 1; ++m)
        {
            temp += datas[m].d;
        }

        float duration = temp * speed - time;

        if (duration < 0)
        {
            duration = 0;
        }
        EZJointTween comp = EZTweener.Begin <EZJointTween>(joint, duration);

        comp.sprite_ = sprite;
        comp.skew_   = skew;
        comp._joint  = joint;
        comp._bone   = bone;
        comp._datas  = datas;
        comp._speed  = speed;
        comp._n      = n;
        comp.setup();
        comp.onFinished = EZJointTween.OnFinished_;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            EZJointTween.OnFinished_(comp);
        }
        return(comp);
    }
Ejemplo n.º 4
0
 public static EZJointTween Begin(GameObject bone, GameObject joint, exSprite sprite, EZSkew skew, JsonSkeletalObj[] datas, float speed)
 {
     return EZJointTween.Play(bone, joint, sprite, skew, datas, speed, 0, 0);
 }