예제 #1
0
    /// <summary>
    /// 创建一个Window
    /// </summary>
    /// <typeparam name="T">创建的是那个类</typeparam>
    /// <param name="_name">swf名字,用于区分各个不同的swf</param>
    /// <param name="_fullPatch">全路径,相对于streamingasset文件夹</param>
    /// <param name="_backgroundColor">背景颜色(255为单位)</param>
    /// <param name="_bVisibleOnCreate">是否创建的时候在画布上显示出来</param>
    /// <param name="_bIgnoreMovie">是否加入忽略列表,目前用于按esc隐藏界面功能</param>
    /// <param name="_modeType">movie的缩放方式</param>
    /// <param name="_fromByteStream">从字节流中创建</param>
    /// <param name="_renderTexture">是否使用Rt</param>
    /// <param name="_scaleModeType">缩放模式</param>
    /// <param name="_movieName">电影名称,暂时忽略</param>
    /// <returns></returns>
    public T CreateWindow <T>(string _name, string _fullPatch, Color32 _backgroundColor, bool _bVisibleOnCreate = false, ScaleModeType _modeType = ScaleModeType.SM_ShowAll, bool _fromByteStream = true, RenderTexture _renderTexture = null, string _movieName = null) where T : Movie
    {
        if (GetWindow(_name) != null)
        {
            return(GetWindow(_name) as T);
        }

        T newMovie = default(T);


        newMovie = GfxUtil.CreateSwf <T>(this, _fullPatch, _fromByteStream, _backgroundColor, _renderTexture, _modeType, _movieName);

        if (null == newMovie)
        {
            return(null);
        }

        SFMovieEx MovieEx = newMovie as SFMovieEx;

        MovieEx.IsVisibleOnCreate = _bVisibleOnCreate;

        windowRegistryList.Add(_name, newMovie);
        return(newMovie);
    }