Exemplo n.º 1
0
 //call correct set target method and set tween application delegate:
 void GenerateTargets()
 {
     switch (type) {
         case "value":
             switch (method) {
                 case "float":
                     GenerateFloatTargets();
                     apply = new ApplyTween(ApplyFloatTargets);
                 break;
             case "vector2":
                     GenerateVector2Targets();
                     apply = new ApplyTween(ApplyVector2Targets);
                 break;
             case "vector3":
                     GenerateVector3Targets();
                     apply = new ApplyTween(ApplyVector3Targets);
                 break;
             case "color":
                     GenerateColorTargets();
                     apply = new ApplyTween(ApplyColorTargets);
                 break;
             case "rect":
                     GenerateRectTargets();
                     apply = new ApplyTween(ApplyRectTargets);
                 break;
             }
         break;
         case "color":
             switch (method) {
                 case "to":
                     GenerateColorToTargets();
                     apply = new ApplyTween(ApplyColorToTargets);
                 break;
             }
         break;
         case "audio":
             switch (method) {
                 case "to":
                     GenerateAudioToTargets();
                     apply = new ApplyTween(ApplyAudioToTargets);
                 break;
             }
         break;
         case "move":
             switch (method) {
                 case "to":
                     //using a path?
                     if(tweenArguments.Contains("path")){
                         GenerateMoveToPathTargets();
                         apply = new ApplyTween(ApplyMoveToPathTargets);
                     }else{ //not using a path?
                         GenerateMoveToTargets();
                         apply = new ApplyTween(ApplyMoveToTargets);
                     }
                 break;
                 case "by":
                 case "add":
                     GenerateMoveByTargets();
                     apply = new ApplyTween(ApplyMoveByTargets);
                 break;
             }
         break;
         case "scale":
             switch (method){
                 case "to":
                     GenerateScaleToTargets();
                     apply = new ApplyTween(ApplyScaleToTargets);
                 break;
                 case "by":
                     GenerateScaleByTargets();
                     apply = new ApplyTween(ApplyScaleToTargets);
                 break;
                 case "add":
                     GenerateScaleAddTargets();
                     apply = new ApplyTween(ApplyScaleToTargets);
                 break;
             }
         break;
         case "rotate":
             switch (method) {
                 case "to":
                     GenerateRotateToTargets();
                     apply = new ApplyTween(ApplyRotateToTargets);
                 break;
                 case "add":
                     GenerateRotateAddTargets();
                     apply = new ApplyTween(ApplyRotateAddTargets);
                 break;
                 case "by":
                     GenerateRotateByTargets();
                     apply = new ApplyTween(ApplyRotateAddTargets);
                 break;
             }
         break;
         case "shake":
             switch (method) {
                 case "position":
                     GenerateShakePositionTargets();
                     apply = new ApplyTween(ApplyShakePositionTargets);
                 break;
                 case "scale":
                     GenerateShakeScaleTargets();
                     apply = new ApplyTween(ApplyShakeScaleTargets);
                 break;
                 case "rotation":
                     GenerateShakeRotationTargets();
                     apply = new ApplyTween(ApplyShakeRotationTargets);
                 break;
             }
         break;
         case "punch":
             switch (method) {
                 case "position":
                     GeneratePunchPositionTargets();
                     apply = new ApplyTween(ApplyPunchPositionTargets);
                 break;
                 case "rotation":
                     GeneratePunchRotationTargets();
                     apply = new ApplyTween(ApplyPunchRotationTargets);
                 break;
                 case "scale":
                     GeneratePunchScaleTargets();
                     apply = new ApplyTween(ApplyPunchScaleTargets);
                 break;
             }
         break;
         case "look":
             switch (method) {
                 case "to":
                     GenerateLookToTargets();
                     apply = new ApplyTween(ApplyLookToTargets);
                 break;
             }
         break;
         case "stab":
             GenerateStabTargets();
             apply = new ApplyTween(ApplyStabTargets);
         break;
     }
 }
Exemplo n.º 2
0
    //call correct set target method and set tween application delegate:
    void GenerateTargets()
    {
        switch (type) {
            case "value":
                switch (method) {
                    case "float":
                        GenerateFloatTargets();
                        apply = new ApplyTween(ApplyFloatTargets);
                    break;
                case "vector2":
                        GenerateVector2Targets();
                        apply = new ApplyTween(ApplyVector2Targets);
                    break;
                case "vector3":
                        GenerateVector3Targets();
                        apply = new ApplyTween(ApplyVector3Targets);
                    break;
                case "color":
                        GenerateColorTargets();
                        apply = new ApplyTween(ApplyColorTargets);
                    break;
                case "rect":
                        GenerateRectTargets();
                        apply = new ApplyTween(ApplyRectTargets);
                    break;
                }
            break;
            case "property":
                switch (method) {
                    case "morph":
                        GenerateMorphTargets();
                        apply = new ApplyTween(ApplyPropertyMorphTargets);
                        break;
                    case "float":
                        GenerateFloatTargets();
                        apply = new ApplyTween(ApplyPropertyFloatTargets);
                    break;
                case "vector2":
                        GenerateVector2Targets();
                        apply = new ApplyTween(ApplyPropertyVector2Targets);
                    break;
                case "vector3":
                        GenerateVector3Targets();
                        apply = new ApplyTween(ApplyPropertyVector3Targets);
                    break;
                case "color":
                        GenerateColorTargets();
                        apply = new ApplyTween(ApplyPropertyColorTargets);
                    break;
                case "rect":
                        GenerateRectTargets();
                        apply = new ApplyTween(ApplyPropertyRectTargets);
                    break;
                }
            break;
            case "color":
                switch (method) {
                    case "to":
                        GenerateColorToTargets();
                        apply = new ApplyTween(ApplyColorToTargets);
                    break;
                }
            break;
            case "audio":
                switch (method) {
                    case "to":
                        GenerateAudioToTargets();
                        apply = new ApplyTween(ApplyAudioToTargets);
                    break;
                }
            break;
            case "move":
                switch (method) {
                    case "to":
                        //using a path?
                        if(tweenArguments.Contains("path")){
                            GenerateMoveToPathTargets();
                            apply = new ApplyTween(ApplyMoveToPathTargets);
                        }else{ //not using a path?
                            GenerateMoveToTargets();
                            apply = new ApplyTween(ApplyMoveToTargets);
                        }
                    break;
                    case "by":
                    case "add":
                        GenerateMoveByTargets();
                        apply = new ApplyTween(ApplyMoveByTargets);
                    break;
                }
            break;
            case "scale":
                switch (method){
                    case "to":
                        GenerateScaleToTargets();
                        apply = new ApplyTween(ApplyScaleToTargets);
                    break;
                    case "by":
                        GenerateScaleByTargets();
                        apply = new ApplyTween(ApplyScaleToTargets);
                    break;
                    case "add":
                        GenerateScaleAddTargets();
                        apply = new ApplyTween(ApplyScaleToTargets);
                    break;
                }
            break;
            case "rotate":
                switch (method) {
                    case "to":
                        GenerateRotateToTargets();
                        apply = new ApplyTween(ApplyRotateToTargets);
                    break;
                    case "add":
                        GenerateRotateAddTargets();
                        apply = new ApplyTween(ApplyRotateAddTargets);
                    break;
                    case "by":
                        GenerateRotateByTargets();
                        apply = new ApplyTween(ApplyRotateAddTargets);
                    break;
                }
            break;
            case "shake":
                switch (method) {
                    case "position":
                        GenerateShakePositionTargets();
                        apply = new ApplyTween(ApplyShakePositionTargets);
                    break;
                    case "scale":
                        GenerateShakeScaleTargets();
                        apply = new ApplyTween(ApplyShakeScaleTargets);
                    break;
                    case "rotation":
                        GenerateShakeRotationTargets();
                        apply = new ApplyTween(ApplyShakeRotationTargets);
                    break;
                }
            break;
            case "punch":
                switch (method) {
                    case "position":
                        GeneratePunchPositionTargets();
                        apply = new ApplyTween(ApplyPunchPositionTargets);
                    break;
                    case "rotation":
                        GeneratePunchRotationTargets();
                        apply = new ApplyTween(ApplyPunchRotationTargets);
                    break;
                    case "scale":
                        GeneratePunchScaleTargets();
                        apply = new ApplyTween(ApplyPunchScaleTargets);
                    break;
                }
            break;
            case "look":
                switch (method) {
                    case "to":
                        GenerateLookToTargets();
                        apply = new ApplyTween(ApplyLookToTargets);
                    break;
                    case "follow":
                        //GenerateLookFollowTargets();
                        apply = new ApplyTween(ApplyLookFollowTargets);
                    break;
                    case "tofollow":
                        GenerateLookToFollowTargets();
                        apply = new ApplyTween(ApplyLookToFollowTargets);
                    break;
                }
            break;
            case "stab":
                GenerateStabTargets();
                apply = new ApplyTween(ApplyStabTargets);
            break;
            case "play":
                switch(method) {
                    case "audio":
                        GeneratePlayAudioTargets();
                        break;
                    case "animation":
                        GeneratePlayAnimationTargets();
                        break;
                }
            break;
            case "camerafade":
                if((int)tweenArguments["camerafadetype"] == (int)Fade.None) {
                    GenerateCameraFadeNoneTargets();
                } else {
                    GenerateCameraFadeTargets();
                    apply = new ApplyTween(ApplyCameraFadeValueTargets);
                }
            break;

        }
    }