Exemple #1
0
        public override void Awake()
        {
            base.Awake();
            DirtyActions.Clear();
            Canvas           = GetComponentInChildren <Canvas>();
            CanvasScaler     = GetComponentInChildren <CanvasScaler>();
            GraphicRaycaster = GetComponentInChildren <GraphicRaycaster>();
            RectTrans        = GetComponent <RectTransform>();
            if (Canvas != null)
            {
                CanvasTrans = Canvas.transform as RectTransform;
            }
            sourceLocalPos = Trans.localPosition;

            if (IsFullScreen && IsAddBlocker)
            {
                var temp = GameObject.Instantiate(GRMgr.UI.Get("BaseBlocker"));
                temp.transform.SetParent(Trans);
                temp.transform.SetAsFirstSibling();
                Blocker = temp.GetComponent <UImage>();
                Blocker.Init(new UImageData {
                    ClickClip = "UI_Error", Color = () => BlockerCol
                });
            }
            if (!IsExclusive)
            {
                IsReturn = false;
            }
        }
Exemple #2
0
        public override void Init(BaseTalkItemData data)
        {
            base.Init(data);
            Bg?.Init(data.Bg);
            KeyTip?.Init(data.KeyTip);
            SelectTip?.Init(data.SelectTip);
            DP_Select.Init <UButton, UButtonData>(Const.Val_MaxTalkOptionCount, data.Option, (p, d) =>
            {
                var pressenter = p as UButton;
                if (CurTalkData.Option.Count > pressenter.Index)
                {
                    pressenter.Show(true);
                    pressenter.NameText = BaseLanguageMgr.Get(CurTalkData.Option[pressenter.Index]);
                }
                else
                {
                    pressenter.Show(false);
                }

                if (data.CurSelectOptionIndex() == pressenter.Index)
                {
                    pressenter.SetSelected(true);
                }
                else
                {
                    pressenter.SetSelected(false);
                }
            }, null);
        }
        protected override void OnCreatedView()
        {
            base.OnCreatedView();

            if (BattleMgr != null)
            {
                BattleMgr.Callback_OnLoadingProgressChanged += OnLoadingProgressChanged;
                BattleMgr.Callback_OnRandTip            += OnRandTip;
                BattleMgr.Callback_OnBattleUnLoad       += OnBattleUnLoad;
                BattleMgr.Callback_OnBattleUnLoaded     += OnBattleUnLoaded;
                BattleMgr.Callback_OnBattleLoadStart    += OnLoadStart;
                BattleMgr.Callback_OnInPauseLoadingView += OnInPauseLoadingView;
            }

            if (SubBattleMgr != null)
            {
                SubBattleMgr.Callback_OnLoadingProgressChanged += OnLoadingProgressChanged;
                SubBattleMgr.Callback_OnRandTip         += OnRandTip;
                SubBattleMgr.Callback_OnBattleUnLoad    += OnBattleUnLoad;
                SubBattleMgr.Callback_OnBattleUnLoaded  += OnBattleUnLoaded;
                SubBattleMgr.Callback_OnGameStart       += OnSubBattleGameStart;
                SubBattleMgr.Callback_OnBattleLoadStart += OnLoadStart;
            }

            InputMgr.Callback_OnAnyKeyDown += OnAnyKeyDown;
            BG?.Init(new UImageData {
                OnClick = OnClickBG
            });
            if (LoadEndTip != null)
            {
                UITweenColor = LoadEndTip.GetComponent <UITweenColor>();
            }
        }
        protected override void OnCreatedView()
        {
            base.OnCreatedView();
            Title.CancleInit();
            DescPool = new GOPool(Desc.gameObject, CanvasGroup.transform);
            Bg.Init(new UImageData {
                OnClick = OnClickBg
            });
            KeyTip.Init(new UTextData {
                Name = GetKeyTip, IsTrans = false
            });
            Desc.Show(false);

            //event
            NarrationMgr.Callback_OnStartNarration += OnStartNarration;
            NarrationMgr.Callback_OnNextNarration  += OnNextNarration;
            NarrationMgr.Callback_OnEndNarration   += OnEndNarration;
        }