Exemplo n.º 1
0
        public override void Awake()
        {
            base.Awake();

            TabController  = controller.transform.Find("Content/LeftSide/CategoryTab").GetMonoILRComponent <FriendTabController>();
            ChatController = controller.transform.Find("Content/RightSide/ChatWindow").GetMonoILRComponent <FriendChatController>();
            DynamicScroll  = controller.transform.Find("Content/LeftSide/Content")
                             .GetMonoILRComponent <FriendItemDynamicScrollManager>();
            titleCon = controller.transform.Find("BGs/Middle/BGs/UpButtons/Title").GetMonoILRComponent <TitleListController>();

            UIButton backButton = controller.transform.Find("BGs/CancelBtn").GetComponent <UIButton>();

            backButton.onClick.Add(new EventDelegate(base.OnCancelButtonClick));

            controller.UiButtons["HotfixBtn1"].onClick.Add(new EventDelegate(AllSendClick));
            controller.UiButtons["HotfixBtn2"].onClick.Add(new EventDelegate(AllGetClick));
            //FriendItem
            controller.transform.GetComponent <ConsecutiveClickCoolTrigger>("Content/RightSide/TopLayout/TargetHead/Icon").clickEvent.Add
                (new EventDelegate(OnHeadBtnClick));
            controller.UiButtons["HotfixBtn4"].onClick.Add(new EventDelegate(OnPkBtnClick));
            controller.UiButtons["HotfixBtn5"].onClick.Add(new EventDelegate(OnDeleteBtnClick));
            //ChatItem
            controller.UiButtons["HotfixBtn6"].onClick.Add(new EventDelegate(OnRemoveBlacklistClick));
        }
Exemplo n.º 2
0
        public override void Awake()
        {
            base.Awake();
            var t = mDMono.transform;

            leftChatItemStruct           = new ChatItemStruct();
            leftChatItemStruct.Container = t.Find("LeftContainer").gameObject;
            if (t.Find("LeftContainer/HeroPortraitTemplate/Icon") != null)
            {
                leftChatItemStruct.HeroIcon  = t.GetComponent <UISprite>("LeftContainer/HeroPortraitTemplate/Icon");
                leftChatItemStruct.FrameIcon = t.GetComponent <UISprite>("LeftContainer/HeroPortraitTemplate/Icon/Frame");
            }
            leftChatItemStruct.Audio      = t.Find("LeftContainer/Audio").gameObject;
            leftChatItemStruct.AudioLabel = t.GetComponent <UISymbolLabel>("LeftContainer/Audio/AudioLabel");
            leftChatItemStruct.Audio.transform.GetComponent <UIButton>("AudioBackground").onClick.Add(new EventDelegate(OnAudioClick));

            leftChatItemStruct.AudioDurationLabel = t.GetComponent <UILabel>("LeftContainer/Audio/AudioBackground/DurationLabel");
            leftChatItemStruct.AudioUnreadSprite  = t.GetComponent <UISprite>("LeftContainer/Audio/AudioBackground/DurationLabel/UnReadSprite");
            leftChatItemStruct.TitleLabel         = t.GetComponent <UISymbolLabel>("LeftContainer/TitleLabel");
            leftChatItemStruct.Text         = t.Find("LeftContainer/Text").gameObject;
            leftChatItemStruct.TextLabel    = t.GetComponent <UISymbolLabel>("LeftContainer/Text/TextLabel");
            leftChatItemStruct.TextBGSprite = t.GetComponent <UISprite>("LeftContainer/Text/TextBackground");
            if (t.Find("LeftContainer/HeroPortraitTemplate/Level/Label") != null)
            {
                t.GetComponent <UIButton>("LeftContainer/HeroPortraitTemplate").onClick.Add(new EventDelegate(ShowOtherPlayerInfo));
                leftChatItemStruct.LevelLabel    = t.GetComponent <UILabel>("LeftContainer/HeroPortraitTemplate/Level/Label");
                leftChatItemStruct.ChannelSprite = t.GetComponent <UISprite>("LeftContainer/ChannelSprite");
                leftChatItemStruct.VipTagTf      = t.Find("LeftContainer/VipObj");

                leftChatItemStruct.AudioSpObjs    = new GameObject[3];
                leftChatItemStruct.AudioSpObjs[0] = t.Find("LeftContainer/Audio/AudioBackground/AudioSpObj/AudioSprite").gameObject;
                leftChatItemStruct.AudioSpObjs[1] = t.Find("LeftContainer/Audio/AudioBackground/AudioSpObj/AudioSprite (1)").gameObject;
                leftChatItemStruct.AudioSpObjs[2] = t.Find("LeftContainer/Audio/AudioBackground/AudioSpObj/AudioSprite (2)").gameObject;
            }


            rightChatItemStruct           = new ChatItemStruct();
            rightChatItemStruct.Container = t.Find("RightContainer").gameObject;
            if (t.Find("RightContainer/HeroPortraitTemplate/Icon") != null)
            {
                rightChatItemStruct.HeroIcon  = t.GetComponent <UISprite>("RightContainer/HeroPortraitTemplate/Icon");
                rightChatItemStruct.FrameIcon = t.GetComponent <UISprite>("RightContainer/HeroPortraitTemplate/Icon/Frame");
            }
            rightChatItemStruct.Audio      = t.Find("RightContainer/Audio").gameObject;
            rightChatItemStruct.AudioLabel = t.GetComponent <UISymbolLabel>("RightContainer/Audio/AudioLabel");
            rightChatItemStruct.Audio.transform.GetComponent <UIButton>("AudioBackground").onClick.Add(new EventDelegate(OnAudioClick));

            rightChatItemStruct.AudioDurationLabel = t.GetComponent <UILabel>("RightContainer/Audio/AudioBackground/DurationLabel");
            rightChatItemStruct.AudioUnreadSprite  = t.GetComponent <UISprite>("RightContainer/Audio/AudioBackground/DurationLabel/UnReadSprite");
            rightChatItemStruct.TitleLabel         = t.GetComponent <UISymbolLabel>("RightContainer/TitleLabel");
            rightChatItemStruct.Text         = t.Find("RightContainer/Text").gameObject;
            rightChatItemStruct.TextLabel    = t.GetComponent <UISymbolLabel>("RightContainer/Text/TextLabel");
            rightChatItemStruct.TextBGSprite = t.GetComponent <UISprite>("RightContainer/Text/TextBackground");
            if (t.Find("RightContainer/HeroPortraitTemplate/Level/Label") != null)
            {
                rightChatItemStruct.LevelLabel = t.Find("RightContainer/HeroPortraitTemplate/Level/Label")
                                                 .GetComponent <UILabel>();
                rightChatItemStruct.ChannelSprite = t.Find("RightContainer/ChannelSprite")
                                                    .GetComponent <UISprite>();
                rightChatItemStruct.VipTagTf = t.Find("RightContainer/VipObj");

                rightChatItemStruct.AudioSpObjs    = new GameObject[3];
                rightChatItemStruct.AudioSpObjs[0] = t.Find("RightContainer/Audio/AudioBackground/AudioSpObj/AudioSprite").gameObject;
                rightChatItemStruct.AudioSpObjs[1] = t.Find("RightContainer/Audio/AudioBackground/AudioSpObj/AudioSprite (1)").gameObject;
                rightChatItemStruct.AudioSpObjs[2] = t.Find("RightContainer/Audio/AudioBackground/AudioSpObj/AudioSprite (2)").gameObject;
            }


            if (t.parent.parent.parent.parent.GetComponent <DynamicMonoILR>() != null)
            {
                FriendChatHud = t.parent.parent.parent.parent.GetMonoILRComponent <FriendChatController>();
            }
        }