Exemple #1
0
    static public EZSkeletalTween Play(GameObject bone, 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;
        }
        EZSkeletalTween comp = EZTweener.Begin <EZSkeletalTween>(bone, duration);

        comp._bone  = bone;
        comp._datas = datas;
        comp._speed = speed;
        comp._n     = n;
        comp.setup();
        comp.onFinished = EZSkeletalTween.OnFinished_;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            EZSkeletalTween.OnFinished_(comp);
        }
        return(comp);
    }
Exemple #2
0
 public static void onClose(EZTweener tween)
 {
     if(tween){
         EZSkeletalTween tw = (EZSkeletalTween)(tween);
         tw.enabled = false;;
         tween._time = 0;
         tw._bone.SendMessage("OnFinished", tw, SendMessageOptions.DontRequireReceiver);
     }
 }
Exemple #3
0
 public static void onClose(EZTweener tween)
 {
     if (tween)
     {
         EZSkeletalTween tw = (EZSkeletalTween)(tween);
         tw.enabled  = false;;
         tween._time = 0;
         tw._bone.SendMessage("OnFinished", tw, SendMessageOptions.DontRequireReceiver);
     }
 }
Exemple #4
0
 public static void OnFinished_(EZTweener tween)
 {
     EZJointTween tw = (EZJointTween)(tween);
     if(tw._n+1 < tw._datas.Length){
         EZJointTween.Play(tw._bone, tw._joint, tw.sprite_, tw.skew_, tw._datas, tw._speed, tw._n+1, tw._time);
     }else{
         tw.enabled = false;
         tw._time = 0;
         tw._bone.SendMessage("OnFinished", tw, SendMessageOptions.DontRequireReceiver);
     }
 }
Exemple #5
0
    public static void OnFinished_(EZTweener tween)
    {
        EZSkeletalTween tw = (EZSkeletalTween)(tween);

        if (tw._n + 1 < tw._datas.Length)
        {
            EZSkeletalTween.Play(tw._bone, tw._datas, tw._speed, tw._n + 1, tw._time);
        }
        else
        {
            tw.enabled = false;
            tw._time   = 0;
            tw._bone.SendMessage("OnFinished", tw, SendMessageOptions.DontRequireReceiver);
        }
    }