Ejemplo n.º 1
0
    /////////////////////////////////////////////////////////////////


    public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp) //:base(_sfMgr, _cp)
    {
        base.Init(_parent, _sfMgr, _cp);
        SFMgr = _sfMgr;

        EntityFactory.SetEntityNumPropHandler(OnCommand_UpdateNumProp);
    }
Ejemplo n.º 2
0
 public RTTMovie(SFManager sfmgr, SFMovieCreationParams cp)
     : base(sfmgr, cp)
 {
     SFMgr = sfmgr;
     this.SetFocus(true);
     InstanceList.Add(this);
 }
Ejemplo n.º 3
0
    public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
    {
        base.Init(_parent, _sfMgr, _cp);

        this.SetFocus(true);
        //  SetViewport(0, 0, 500, 600);
    }
Ejemplo n.º 4
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     base.Init(_parent, _sfMgr, _cp);
     GameSettingsXmlModel = GameSettingsXmlManager.Instance.GameSettingsModel;
     bSaveHandle          = true;
     e = Event.current;
 }
Ejemplo n.º 5
0
            public Movie(SFManager sfmgr, SFMovieCreationParams creationParams)
            {
                if (sfmgr == null)
                {
                    MovieID = 0;
                    return;
                }

                MovieName             = creationParams.MovieName;
                ViewPort.OX           = creationParams.OX;
                ViewPort.OY           = creationParams.OY;
                ViewPort.Width        = creationParams.Width;
                ViewPort.Height       = creationParams.Height;
                pDataUnmanaged        = creationParams.pData;
                MovieID               = 0; // Assigned when the C++ Movie is created.
                MarkForRelease        = false;
                SFMgr                 = sfmgr;
                IsFocused             = false;
                AdvanceWhenGamePaused = false;
                IsAutoManageViewport  = creationParams.IsAutoManageViewport;
                TheScaleModeType      = creationParams.TheScaleModeType;

                int cpSize = Marshal.SizeOf(typeof(SFMovieCreationParams));

                IntPtr pdata = Marshal.AllocCoTaskMem(cpSize);

                Marshal.StructureToPtr(creationParams, pdata, false);

                MovieID = SF_CreateMovie(pdata);
                Marshal.DestroyStructure(pdata, typeof(SFMovieCreationParams));
                if (MovieID != -1)
                {
                    SFMgr.AddMovie(this);
                }
            }
Ejemplo n.º 6
0
    public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
    {
        base.Init(_parent, _sfMgr, _cp);

        MobaSchemesManager = GameMobaSchemesManager.Instance;
        bIsFloat           = true;
    }
Ejemplo n.º 7
0
 // Use this for initialization
 public MenuMovie(SFCamera parent, SFManager sfmgr, SFMovieCreationParams cp) :
     base(sfmgr, cp)
 {
     this.parent = parent;
     SFMgr       = sfmgr;
     this.SetFocus(true);
 }
Ejemplo n.º 8
0
 public RenderTextureDemo(SFManager sfmgr, SFMovieCreationParams cp) :
     base(sfmgr, cp)
 {
     SFMgr = sfmgr;
     this.SetFocus(true);
     instance = this;
 }
Ejemplo n.º 9
0
    public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
    {
        base.Init(_parent, _sfMgr, _cp);
        MyInvokeQ         = new InvokeQ();
        bCanSyncTickCount = true;

        EventManager.Subscibe(this, EVENT.ENTITY_SHOW_HERO, 0);
    }
Ejemplo n.º 10
0
    protected virtual ScaleformMovie createMovie()
    {
        SFMovieCreationParams creationParams = CreateMovieCreationParams(FlashMovieFile);

        creationParams.TheScaleModeType = ScaleMode;
        creationParams.IsInitFirstFrame = false;
        return(new ScaleformMovie(this, SFMgr, creationParams));
    }
Ejemplo n.º 11
0
    public ScaleformMovie(ScaleformLayer layer, SFManager sfmgr, SFMovieCreationParams creationParams) :
        base(sfmgr, creationParams)
    {
        Layer     = layer;
        SFManager = sfmgr;

        SetFocus(true);
    }
Ejemplo n.º 12
0
    public ScaleformMovie(ScaleformLayer layer, SFCamera cam, SFMovieCreationParams creationParams) :
        base(cam.GetSFManager(), creationParams)
    {
        Layer  = layer;
        Camera = cam;

        SetFocus(true);
    }
Ejemplo n.º 13
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     base.Init(_parent, _sfMgr, _cp);
     bCanSyncTickCount = true;
     _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_PA, 0); _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_MA, 0);
     _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_PD, 0); _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_MD, 0);
     _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_AF, 0); _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_PCT_COOL_REDUCE, 0);
     _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_CRC, 0); _propertyValue.Add(ENTITY_PROPERTY.PROPERTY_SD, 0);
 }
Ejemplo n.º 14
0
    public ScaleformMovie(SFManager sfmgr, SFMovieCreationParams cp) :
        base(sfmgr, cp)
    {
        beginValues  = new Value[3];
        moveValues   = new Value[3];
        endValues    = new Value[1];
        cancelValues = new Value[1];

        SetFocus(true);
    }
Ejemplo n.º 15
0
 private void CreateGameHud()
 {
     if (demo1 == null)
     {
         SFMovieCreationParams creationParams = CreateMovieCreationParams(swfFile);
         creationParams.TheScaleModeType = ScaleModeType.SM_ShowAll;
         creationParams.IsInitFirstFrame = false;
         demo1 = new MainMenu(this, SFMgr, creationParams);
     }
 }
Ejemplo n.º 16
0
    public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
    {
        bCanSyncTickCount = true;
        base.Init(_parent, _sfMgr, _cp);

        SFGFxMovieManager.Instance.AddMovieToIgnoreHitTestList(this);

        //TimerManager.SetTimer(this, (int)EN_GameHud_Timer.ENGT_Pointer, 0.5f);
        //EventManager.Subscibe(this, EVENT.ENTITY_SHOW_HERO, 0);
    }
Ejemplo n.º 17
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     _instance = this;
     base.Init(_parent, _sfMgr, _cp);
     InitAspectRatio();
     if (UBBPropertyInstance == null)
     {
         Trace.LogError("获取UBBProperty单实例失败");
         return;
     }
     UBBPropertyInstance.PropertyUBB();
 }
Ejemplo n.º 18
0
    private void Update()
    {
        if (movie == null)
        {
            if (scaleformCamera == null)
            {
                return;
            }
            var manager = scaleformCamera.GetSFManager();
            if (manager == null || !manager.IsSFInitialized())
            {
                return;
            }

            SFMovieCreationParams creationParams = SFCamera.CreateMovieCreationParams(FlashMovieFile, MovieDepth, BackgroundColor, OverrideBackgroundColor);
            creationParams.IsInitFirstFrame = InitFirstFrame;
            creationParams.TheScaleModeType = ScaleMode;

            movie = createMovie(creationParams);
        }
    }
Ejemplo n.º 19
0
    public bool CreateRenderMovie(SFCamera camera, Type movieClassType)
    {
#if !(UNITY_4_0 || UNITY_4_1) && UNITY_STANDALONE_WIN
        if (SystemInfo.graphicsDeviceVersion[0] == 'D')
        {
            return(false);
        }
#endif
        if (RenderTexture == null)
        {
            Debug.Log("RenderTexture is null, failure to create RenderMovie. Check if you specified all the parameters properly.");
            return(false);
        }
        if (RTTMovie == null || RTTMovie.MovieID == 0)
        {
            if (camera)
            {
                Debug.Log("Creating movie");
                SFMovieCreationParams creationParams = SFCamera.CreateRTTMovieCreationParams(SwfName, OriginX, OriginY, RenderTexture, ClearColor);
                creationParams.TheScaleModeType     = ScaleModeType.SM_ExactFit;
                creationParams.IsInitFirstFrame     = true;
                creationParams.IsAutoManageViewport = false;
                // Has the user specified a movie subclass?
                if (movieClassType != null)
                {
                    SFManager sfMgr = camera.GetSFManager();
                    RTTMovie = Activator.CreateInstance(movieClassType, sfMgr, creationParams) as Movie;
                    if (RTTMovie != null)
                    {
                        RTTMovie.SetRTT(this);
                    }
                    return(true);
                }
            }
        }
        return(false);
    }
Ejemplo n.º 20
0
            /// <summary>
            /// Creates a movie instance according to the specified movie creation parameters. 
            /// </summary>
            /// <param name="creationParams"> Movie Creation Parameters such as viewport size, type of actionscript VM to initialize.</param>
            /// <returns>C++ movie pointer cast as an integer. </returns>
            public long CreateInstance(SFMovieCreationParams creationParams)
            {
                if (pMovieDef == IntPtr.Zero)
                {
                return 0;
                }

                long movieId = 0;

                if (pCreationParams == IntPtr.Zero)
                {
                int cpSize = Marshal.SizeOf(typeof(SFMovieCreationParams));
                pCreationParams = Marshal.AllocCoTaskMem(cpSize);
                Marshal.StructureToPtr(CreationParams, pCreationParams, false);
                }
                #if UNITY_WP8
                movieId = Movie.sf_createMovieInstance(pMovieDef, pCreationParams);
                #else
                movieId = Movie.SF_CreateMovieInstance(pMovieDef, pCreationParams);
                #endif
                //		Marshal.DestroyStructure(pCreationParams, typeof(SFMovieCreationParams));

                return movieId;
            }
Ejemplo n.º 21
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     base.Init(_parent, _sfMgr, _cp);
     SFGFxMovieManager.Instance.AddMovieToIgnoreHitTestList(this);
 }
Ejemplo n.º 22
0
    /// <summary>
    /// Create and return a new movie instance with the given swfName.
    /// </summary>
    /// <returns>
    /// An instance of class T.
    /// </returns>
    /// <param name='camera'>
    /// 创建的Swf属于哪个SFCamera
    /// </param>
    /// <param name='swfName'>
    /// A path to the SWF or GFX file relative to the StreamingAssets folder.
    /// </param>
    /// <param name='fromByteStream'>
    /// If true, an attempt will be made to load this file into memory. On some platforms, this is useful when there isn't a real file path.
    /// </param>
    /// <param name='backgroundColor'>
    /// The background clear color for this movie.
    /// </param>
    /// <param name='renderTarget'>
    /// The RenderTarget to use when rendering this movie. A null value just renders to the screen.
    /// </param>
    /// <param name='scaleModeType'>
    /// Override the default ScaleModeType for this movie. Default is SM_ShowAll.
    /// </param>
    /// <typeparam name='T'>
    /// The class type that will be instanced for this movie.
    /// </typeparam>
    public static T CreateSwf <T>(SFCamera camera, string swfName, bool fromByteStream, Color32 backgroundColor, RenderTexture renderTarget = null, ScaleModeType scaleModeType = ScaleModeType.SM_ShowAll, string movieName = null) where T : Movie
    {
        if (camera == null)
        {
            return(default(T));
        }

        int    depth = 1;
        bool   initFirstFrame = false;
        bool   useBackgroundColor = false;
        bool   autoManageViewport = true;
        int    ox = 0, oy = 0, width = 0, height = 0;
        Int32  length        = 0;
        IntPtr unmanagedData = IntPtr.Zero;

        Byte[] swfBytes = null;

        // load the swf either from a byte array or via path
        SFMovieCreationParams creationParams;


        if (renderTarget != null)
        {
            ox     = 0;
            oy     = 0;
            width  = renderTarget.width;
            height = renderTarget.height;

            useBackgroundColor = true;
            autoManageViewport = false;
        }
        else
        {
            SFCamera.GetViewport(ref ox, ref oy, ref width, ref height);
        }


        bool loadSucceeded = false;

        if (fromByteStream)
        {
            swfBytes = LoadFileToMemory(swfName);
            if (swfBytes != null && swfBytes.Length > 0)
            {
                loadSucceeded = true;

                length        = swfBytes.Length;
                unmanagedData = new IntPtr();
                unmanagedData = Marshal.AllocCoTaskMem((int)length);
                Marshal.Copy(swfBytes, 0, unmanagedData, (int)length);
            }
            else
            {
                Debug.Log("Unable to load swf from memory!");
            }
        }
        else
        {
            // no more to do here -- pass it on to the runtime.
            loadSucceeded = true;
        }


        string fullSwfPath = SFManager.GetScaleformContentPath() + swfName;

        creationParams = new SFMovieCreationParams(fullSwfPath, depth, ox, oy, width, height,
                                                   unmanagedData, length, initFirstFrame, renderTarget, backgroundColor, useBackgroundColor, scaleModeType,
                                                   autoManageViewport);


        if (movieName != null)
        {
            creationParams.MovieName = movieName;
        }

        if (loadSucceeded)
        {
            // create and return the instance
            GameObject uigo = new GameObject(Path.GetFileName(creationParams.MovieName));
            uigo.transform.parent = SFGFxMovieManager.Instance.uigroup.transform;
            T instance = uigo.AddComponent <T>();
            instance.Init(SFGFxMovieManager.Instance, camera.GetSFManager(), creationParams);
            //T instance = (T)Activator.CreateInstance(typeof(T), camera, camera.GetSFManager(), creationParams);

            return(instance);
        }
        else
        {
            Debug.Log(String.Format("Unable to load swf named: {0}", swfName));
            return(default(T));
        }
    }
Ejemplo n.º 23
0
            public Movie(SFManager sfmgr, SFMovieCreationParams creationParams)
            {
                if (sfmgr == null)
                {
                MovieID = 0;
                return;
                }

                MovieName                   = creationParams.MovieName;
                ViewPort.OX                 = creationParams.OX;
                ViewPort.OY                 = creationParams.OY;
                ViewPort.Width              = creationParams.Width;
                ViewPort.Height             = creationParams.Height;
                pDataUnmanaged				= creationParams.pData;
                MovieID                     = 0; // Assigned when the C++ Movie is created.
                MarkForRelease              = false;
                SFMgr                       = sfmgr;
                IsFocused                  	= false;
                AdvanceWhenGamePaused      	= false;
                IsAutoManageViewport        = creationParams.IsAutoManageViewport;
                TheScaleModeType			= creationParams.TheScaleModeType;

                int cpSize = Marshal.SizeOf(typeof(SFMovieCreationParams));

                IntPtr pdata = Marshal.AllocCoTaskMem(cpSize);
                Marshal.StructureToPtr(creationParams, pdata, false);

                MovieID = SF_CreateMovie(pdata);
                Marshal.DestroyStructure(pdata, typeof(SFMovieCreationParams));
                if (MovieID != -1)
                {
                SFMgr.AddMovie(this);
                }
            }
Ejemplo n.º 24
0
 /// <summary>
 /// Creates a movie definition from a given movie name. The movie name must be the absolute pathname of the SWF or GFX file on the system.
 /// </summary>
 /// <param name="movieName"> Moviename corresponds to the absolute pathname of the swf/gfx file on the system.</param>
 public MovieDef(SFMovieCreationParams creationParams)
 {
     // This is not yet implemented.
     pMovieDef = IntPtr.Zero;
 }
Ejemplo n.º 25
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     base.Init(_parent, _sfMgr, _cp);
     //  this.TheScaleModeType = ScaleModeType.SM_ShowAll;
 }
Ejemplo n.º 26
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     base.Init(_parent, _sfMgr, _cp);
     bCanSyncTickCount = true;
 }
Ejemplo n.º 27
0
            /// <summary>
            /// Movie constructor, moviedef is created automatically. 
            /// </summary>
            /// <param name="sfmgr">Scaleform manager.</param>
            /// <param name="creationParams">Movie creation parameters.</param>
            public Movie(SFManager sfmgr, SFMovieCreationParams creationParams)
            {
                if(sfmgr == null)
                {
                MovieID = 0;
                return;
                }

                //1. Set parameters like name and viewport
                MovieName               = creationParams.MovieName;
                ViewPort.OX             = creationParams.OX;
                ViewPort.OY             = creationParams.OY;
                ViewPort.Width          = creationParams.Width;
                ViewPort.Height         = creationParams.Height;
                pDataUnmanaged			= creationParams.pData;
                Depth					= creationParams.Depth; // Rendering order. Movie with Depth + 1 will render on top of Movie with Depth
                MovieID                 = 0; // Assigned when the C++ Movie is created.
                MarkForRelease          = false;
                SFMgr                   = sfmgr;
                IsFocused               = false;
                AdvanceWhenGamePaused   = false;
                IsAutoManageViewport    = creationParams.IsAutoManageViewport;
                TheScaleModeType		= creationParams.TheScaleModeType;

                int cpSize = Marshal.SizeOf(typeof(SFMovieCreationParams));
                IntPtr pCreationParams = Marshal.AllocCoTaskMem(cpSize);
                Marshal.StructureToPtr(creationParams, pCreationParams, false);
                MovieID = SF_CreateMovie(pCreationParams);

                if(MovieID == 0)
                {
                return;
                }

                //3. Add into SFManager
                SFMgr.AddMovie(this);
            }
Ejemplo n.º 28
0
 public override void Init(SFGFxMovieManager _parent, SFManager _sfMgr, SFMovieCreationParams _cp)
 {
     base.Init(_parent, _sfMgr, _cp);
 }
Ejemplo n.º 29
0
 protected virtual ScaleformMovie createMovie(SFMovieCreationParams creationParams)
 {
     return(new ScaleformMovie(this, scaleformCamera, creationParams));
 }