Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

simple swf animations into unity3

Discussion in 'Formats & External Tools' started by television, May 30, 2011.

  1. television

    television

    Joined:
    May 30, 2011
    Posts:
    4
    Download -> View attachment $UNITY-an.zip

    This is a converter pipeline from Flash .SWF files to Unity GL.Begin/GL.End scripts.
    It is a patched pipeline, that uses two different codes from the net.
    Samples are provided, and a how-to that describes how to use it.
    It is in no way a complete Flash to Unity converter, and I have no intention of improving it further.

    Here is a sample script it generates:
    Create new Javascript->paste code->drag it onto the camera
    Code (csharp):
    1.  
    2. private var lineMaterial : Material;
    3. private var frame = 0;
    4. private var myData:Array;
    5.  
    6. var animSpeed:float = 12.0; //fps
    7. var scaleX:float = 0.75;
    8. var scaleY:float = 1.2;
    9. var offsetX:float = 0.3;
    10. var offsetY:float = -0.35;
    11.  
    12. private var startTime;
    13.  
    14. function Awake () {    
    15.     lineMaterial = new Material( "Shader \"Lines/Colored Blended\" {" +
    16.         "SubShader { Pass {" +
    17.         "   BindChannels { Bind \"Color\",color }" +    //  "   Blend SrcAlpha OneMinusSrcAlpha" +
    18.         "   ZWrite On Cull Off Fog { Mode Off }" +
    19.         "} } }");
    20.     lineMaterial.hideFlags = HideFlags.HideAndDontSave;
    21.     lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
    22.    
    23.     getMyData();
    24.    
    25.     for (var f=0; f<myData.length; f++) {      
    26.     for (var s=0;s<myData[f][0];s++){
    27.         var p=s*2+2;
    28.         Debug.Log("max="
     
    Last edited: Dec 23, 2011
  2. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    i will give a try!. thanks .;D
     
  3. madmaxmon

    madmaxmon

    Joined:
    Oct 7, 2010
    Posts:
    19
    Coming from a Flash background and just starting to learn Unity I wonder if you could enlighten me further regarding:

    "This is a converter pipeline from Flash .SWF files to Unity GL.Begin/GL.End scripts."

    I understand (or guessing) a flash animated (simple) swf could be converted into something intelligible to Unity.

    What are the Unity GL.Begin/GL.End scripts, and what could I do with it?

    Could I, for example, have some plane in a scene and play the animated swf on it?

    Cheers,
    Max