コード例 #1
0
        /// <summary>
        /// 初始化UIManager,注册UI事件监听,和UIHighlightCamera
        /// </summary>
        /// <param name="uiTool"></param>
        /// <param name="uiRoot"></param>
        /// <returns></returns>
        public override bool Init(IXUITool uiTool, Transform uiRoot)
        {
            bool result;

            if (null == uiTool || null == uiRoot)
            {
                result = false;
            }
            else
            {
                if (!base.Init(uiTool, uiRoot))
                {
                    this.m_log.Error("false == base.Init(uiTool,uiRoot)");
                    result = false;
                }
                else
                {
                    base.RegisterUIEventHandler(UnityGameEntry.Instance.gameObject);
                    base.RegisterLoadResAsynEventHandler(new LoadTextureAsynEventHandler(ResourceManager.singleton.LoadTexture));
                    base.RegisterTipShowEventHandler(new TipShowEventHandler(this.TipShow));
                    base.RegisterTipGetterEventHandler(new TipGetterEventHandler(this.GetTip));
                    base.RegisterAddListItemEventHandler(new AddListItemEventHandler(this.OnAddListItem));
                    XUIObjectBase.RegisterClickFilter(new FilterUIEventHandler(this.OnUIObjectEventFilter));
                    XLog.Log.Debug("UIManager Init Success!");
                    Transform transform = uiRoot.transform.parent.Find("CameraHighLight");
                    if (transform != null)
                    {
                        this.m_UIHightLightCamera = transform.gameObject.GetComponent <Camera>();
                    }
                    result = true;
                }
            }
            return(result);
        }
コード例 #2
0
    private void Start()
    {
        this.m_log.Debug("UnityGameEntry.Start()");
        InvokeRepeating("Tick", 1, 0.1f);
        //初始化神兽根节点
        if (base.transform.parent != null)
        {
            this.m_transBeastRoot = base.transform.parent.FindChild("Beasts");
        }
        if (null == this.m_transBeastRoot)
        {
            XLog.Log.Fatal("null == m_transHeroRoot");
        }
        ///初始化UIManager
        if (null != this.m_objUIRoot)
        {
            IXUITool uiTool = this.m_objUIRoot.GetComponent("XUITool") as IXUITool;
            UIManager.singleton.Init(uiTool, this.m_objUIRoot);
        }
        //为UICamera自动添加模糊脚本

        /* GameObject gameObject = GameObject.Find("UI Root/Camera");
         * if (gameObject != null && gameObject.GetComponent<BlurEffect>() == null)
         * {
         *   this.m_camBlurEffect = gameObject.AddComponent<BlurEffect>();
         *   this.m_camBlurEffect.blurShader = Shader.Find("Hidden/BlurEffectConeTap");
         *   this.m_camBlurEffect.iterations = 2;
         *   this.m_camBlurEffect.enabled = false;
         * }
         */
        this.MainCameraCullingMask = Camera.main.cullingMask;
        if (Application.isMobilePlatform)
        {
            Camera main = Camera.main;
            if (null != main)
            {
                Component component = main.gameObject.GetComponent("ContrastEnhance");
                UnityEngine.Object.Destroy(component);
                component = main.gameObject.GetComponent("Bloom");
                UnityEngine.Object.Destroy(component);
                component = main.gameObject.GetComponent("AntialiasingAsPostEffect");
                UnityEngine.Object.Destroy(component);
            }
        }
        Singleton <XRenderTextureManager> .singleton.CreateXRenderTexture(EnumRenderTextureType.eRenderTextureType_OutLine, this.outterLineCamera, (int)this.outterLineCamera.pixelWidth, (int)this.outterLineCamera.pixelHeight);

        Singleton <ClientMain> .singleton.Start();
    }
コード例 #3
0
        /// <summary>
        /// 初始化UIManager,因为UImanager都是底层LocalUIManagerBase来执行的
        /// 主要初始化UITool,UIRoot,HighlightCamera
        /// </summary>
        /// <param name="uiTool"></param>
        /// <param name="uiRoot"></param>
        /// <returns></returns>
        public bool Init(IXUITool uiTool, Transform uiRoot)
        {
            if (uiTool == null || null == uiRoot)
            {
                return(false);
            }
            this.m_uiTool = uiTool;
            this.m_uiRoot = uiRoot;
            this.m_log.Debug("UIManager Init Success!");
            Transform transform = uiRoot.transform.parent.Find("CameraHighLight");

            if (transform != null)
            {
                this.m_highlightCamera = transform.gameObject.GetComponent <Camera>();
            }
            return(true);
        }
コード例 #4
0
 public XUIPool(IXUITool uiTool)
 {
     this._uiTool = uiTool;
 }
コード例 #5
0
 /// <summary>
 /// 初始化UIManager,因为UImanager都是底层LocalUIManagerBase来执行的
 /// 主要初始化UITool,UIRoot,HighlightCamera
 /// </summary>
 /// <param name="uiTool"></param>
 /// <param name="uiRoot"></param>
 /// <returns></returns>
 public virtual bool Init(IXUITool uiTool, Transform uiRoot)
 {
     return(Singleton <LocalUIManagerBase> .singleton.Init(uiTool, uiRoot));
 }