private void Awake() { _live2DGraphic = transform.Find("CharacterContainer/Live2dGraphic").GetComponent <Live2dGraphic>(); if ((float)Screen.height / Screen.width > 1.8f) { _live2DGraphic.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); } _bgImage = transform.Find("BG").GetComponent <RawImage>(); }
private void Awake() { _live2DGraphic = transform.Find("CharacterContainer/Live2dGraphic").GetComponent <Live2dGraphic>(); if ((float)Screen.height / Screen.width > 1.8f) { _live2DGraphic.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); } _bgBG = transform.Find("BG").GetComponent <RawImage>(); _shareBtn = transform.Find("Btn/ShareBtn").GetComponent <Button>(); _saveBtn = transform.Find("Btn/SaveBtn").GetComponent <Button>(); _shareBtn.onClick.AddListener(OnShareBtn); _saveBtn.onClick.AddListener(OnSaveBtn); _tabBar = transform.Find("TabBar"); for (int i = 0; i < _tabBar.childCount; i++) { Toggle toggle = _tabBar.GetChild(i).GetComponent <Toggle>(); toggle.onValueChanged.AddListener(OnTabChange); } _aniOnClickControl = transform.Find("AniOnClickControl").gameObject; PointerClickListener.Get(_aniOnClickControl).onClick = go => { var slideContainers = transform.GetRectTransform("SlideContainers"); _tabBar.GetRectTransform().DOAnchorPos(new Vector2(0, -329f), 0.5f); slideContainers.DOAnchorPosX(208, 0.5f); var btn = transform.GetRectTransform("Btn"); btn.DOAnchorPosY(0, 0.5f); // _tabBar.GetChild(0).localPosition = new Vector2(0, _tabBar.GetChild(0).localPosition.y); // _tabBar.GetChild(1).localPosition = new Vector2(0, _tabBar.GetChild(1).localPosition.y); }; _clothHint = transform.Find("ClothHint"); _clothHint.gameObject.Hide(); _clothParent = transform.Find("SlideContainers/ClothingList/Content"); _backgroundParent = transform.Find("SlideContainers/BackgroundList/Content"); SetShowShareBtn(); }
private void Awake() { _bgImage = transform.GetRawImage("Bg"); _roleContent = transform.Find("RoleContent"); _btnContent = transform.Find("BtnContent"); _songContent = transform.Find("SongContent"); _btnContent.GetButton("PlayBtn").onClick.AddListener(PlayBtn); _btnContent.GetButton("RankingBtn").onClick.AddListener(RankingBtn); _btnContent.GetButton("ExchangeShopBtn").onClick.AddListener(ExchangeShopBtn); _live2dGraphic = transform.Find("CharacterContainer/Live2dGraphic").GetComponent<Live2dGraphic>(); if ((float) Screen.height / Screen.width > 1.8f) { _live2dGraphic.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, 0); } }
private void Awake() { _maxLevel = GlobalData.FavorabilityMainModel.GetLatsFavorabilityLevelRulePB().Level; _redHeart = transform.Find("Redheart"); _level = _redHeart.GetText("Image/LevelText"); _progressBar = _redHeart.Find("ProgressBar").GetComponent <ProgressBar>(); _progressText = _redHeart.GetText("ProgressText"); _live2DGraphic = transform.Find("CharacterContainer/Live2dGraphic").GetComponent <Live2dGraphic>(); if ((float)Screen.height / Screen.width > 1.8f) { _live2DGraphic.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); } _bgImage = transform.Find("BG").GetComponent <RawImage>(); _btn = transform.Find("Btn"); _showinMain = transform.Find("Btn/ShowInMain").GetComponent <Button>(); _cloth = transform.Find("Btn/Cloth").GetComponent <Button>(); _npcInfoBtn = transform.Find("Btn/NpcInfo").GetComponent <Button>(); _sendGift = transform.Find("Btn/SendGift").GetComponent <Button>(); _showinMain.onClick.AddListener(ShowInMain); _cloth.onClick.AddListener(OnCloth); _npcInfoBtn.onClick.AddListener(PhoneEvent); _sendGift.onClick.AddListener(SendGift); _onClick = transform.Find("OnClick").gameObject; _onClick.Hide(); GuideSet(); _head = transform.Find("CharacterContainer/Live2dGraphic/Head"); _body = transform.Find("CharacterContainer/Live2dGraphic/Body"); PointerClickListener.Get(_head.gameObject).onClick = Live2dClickTigger; PointerClickListener.Get(_body.gameObject).onClick = Live2dClickTigger; _voice = transform.GetButton("Btn/VoiceCollect"); _voice.onClick.AddListener(VoiceBtn); }
private void Awake() { _isArrowGoto = false; _touchArrow = transform.Find("Buttons/StartBtn/TouchArrow"); GuideArrow.DoAnimation(_touchArrow); _exchangeIntegralBar = transform.Find("TopBar/ExchangeIntegralBar"); _visitPower = transform.Find("TopBar/VisitPowerBar"); _recolletionBar = transform.Find("TopBar/RecolletionBar"); _bgRawImage = transform.Find("BackGround/Bg").GetComponent <RawImage>(); _startButton = transform.Find("Buttons/StartBtn").GetComponent <Button>(); _drawCardBtn = transform.Find("Buttons/RightBtnContent/DrawCardBtn").GetComponent <Button>(); _supporterBtn = transform.Find("StartPathBtnContainer/SupporterBtn").GetComponent <Button>(); _missionBtn = transform.Find("Buttons/RightBtnContent/MissionBtn").GetComponent <Button>(); _achievementBtn = transform.Find("Buttons/RightBtnContent/AchievementBtn").GetComponent <Button>(); _changeRoleBtn = transform.Find("Buttons/LeftBtnContent/ChangeRoleBtn").GetComponent <Button>(); _userInfoView = transform.Find("UserInfoView"); _fullviewBtn = transform.Find("Buttons/LeftBtnContent/FullViewBtn").GetComponent <Button>(); _stagingPostBtn = transform.Find("Buttons/LeftBtnContent/StagingPostBtn").GetComponent <Button>(); _starActivityBtn = transform.GetButton("Buttons/RightBtnContent/StarActivityBtn"); _birthdayBtn = transform.GetButton("Buttons/RightBtnContent/BirthdayBtn"); _activityTemplateBtn = transform.GetButton("Buttons/RightBtnContent/ActivityTemplateBtn"); _activityCapsuleTemplateBtn = transform.GetButton("Buttons/RightBtnContent/ActivityCapsuleTemplateBtn"); _activityMusicTemplateBtn = transform.GetButton("Buttons/RightBtnContent/ActivityMusicTemplateBtn"); _animator = this.GetComponent <Animator>(); _uiv = _userInfoView.GetComponent <UserInfoView>(); _backGround = transform.Find("BackGround"); _characterContainer = transform.Find("CharacterContainer"); _live2dGraphic = _characterContainer.Find("Live2dGraphic").GetComponent <Live2dGraphic>(); if ((float)Screen.height / Screen.width > 1.8f) { _live2dGraphic.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); } _starLineBack = _characterContainer.Find("StarLineBack"); _starLineFront = _characterContainer.Find("StarLineFront"); _phoneBtn = transform.Find("StartPathBtnContainer/PhoneBtn").GetComponent <Button>(); _mailBtn = transform.Find("StartPathBtnContainer/MailBtn").GetComponent <Button>(); _cardBtn = transform.Find("Buttons/CardBtn").GetComponent <Button>(); _appointmentBtn = transform.Find("StartPathBtnContainer/AppointmentBtn").GetComponent <Button>(); _firstRechargeBtn = transform.GetButton("Buttons/LeftBtnContent/FirstRecharge"); _totalRechargeBtn = transform.GetButton("Buttons/LeftBtnContent/11"); _topBar = transform.Find("TopBar"); _powerBar = _topBar.Find("PowerBar"); _powerIconImage = _powerBar.Find("powerIcon").GetComponent <Image>(); _powerIcon = _powerBar.Find("powerIcon/OnClick"); _powerAddIcon = _powerBar.Find("addIcon/OnClick"); _powerAddImg = _powerBar.Find("addIcon"); _goldBar = _topBar.Find("GoldBar"); _goldAddIcon = _goldBar.Find("addIcon/OnClick"); _gemBar = _topBar.Find("GemBar"); _powerTxt = _topBar.Find("PowerBar/Text").GetComponent <Text>(); _goldTxt = _topBar.Find("GoldBar/Text").GetComponent <Text>(); _gemTxt = _topBar.Find("GemBar/Text").GetComponent <Text>(); _visitPowerTxt = _topBar.Find("VisitPowerBar/Text").GetComponent <Text>(); _buttons = transform.Find("Buttons"); _startPathBtnContainer = transform.Find("StartPathBtnContainer"); _triggerGiftBtn = transform.GetButton("Buttons/TriggerGiftBtn"); _triggerGiftText = transform.GetText("Buttons/TriggerGiftBtn/TextBg/Text"); _activityBar = transform.Find("ActivityBar"); _activityPanel = _activityBar.Find("Panel"); _activityPage = _activityBar.Find("PageNums"); _drawCardBtn.onClick.AddListener(OnDrawCardBtn); _startButton.onClick.AddListener(OnStartBtn); _supporterBtn.onClick.AddListener(OnSupporterBtn); _missionBtn.onClick.AddListener(OnMissionBtn); _fullviewBtn.onClick.AddListener(OnFullViewBtn); _stagingPostBtn.onClick.AddListener(OnStagingPostBtn); _appointmentBtn.onClick.AddListener(OnAppointmentBtn); _phoneBtn.onClick.AddListener(OnPhoneBtn); _cardBtn.onClick.AddListener(OnCardBtn); _mailBtn.onClick.AddListener(OnMailBtn); _changeRoleBtn.onClick.AddListener(OnChangeRoleBtn); _achievementBtn.onClick.AddListener(OnAchievementBtn); _firstRechargeBtn.onClick.AddListener(OnFirstRechargeBtn); _totalRechargeBtn.onClick.AddListener(OntotalRechargeBtn); _starActivityBtn.onClick.AddListener(OnStarActivityBtn); _birthdayBtn.onClick.AddListener(OnBirthdayBtn); _activityTemplateBtn.onClick.AddListener(ActivityTemplateBtn); _activityCapsuleTemplateBtn.onClick.AddListener(ActivityCapsuleTemplateBtn); _activityMusicTemplateBtn.onClick.AddListener(ActivityMusicTemplateBtn); _triggerGiftBtn.onClick.AddListener(ShowTriggerGift); _triggerGiftBtn.gameObject.Hide(); PointerClickListener.Get(_powerIcon.gameObject).onClick = PowerHint; //点击体力图标 PointerClickListener.Get(_powerAddIcon.gameObject).onClick = BuyPower; PointerClickListener.Get(_goldAddIcon.gameObject).onClick = BuyGold; PointerClickListener.Get(_gemBar.gameObject).onClick = BuyGem; PointerClickListener.Get(_userInfoView.gameObject).onClick = PopupUserInfo; // PointerClickListener.Get(_live2dGraphic.gameObject).onClick = PlayDialog; // UIEventListener.Get(_live2dGraphic.gameObject).onUp = Live2dTigger; PointerClickListener.Get(_recolletionBar.Find("addIcon/OnClick").gameObject).onClick = BuyRecolletionPower; PointerClickListener.Get(_recolletionBar.Find("powerIcon/OnClick").gameObject).onClick = BuyRecolletionPowerHint; PointerClickListener.Get(_visitPower.Find("addIcon/OnClick").gameObject).onClick = BuySupporterPower; PointerClickListener.Get(_visitPower.Find("powerIcon/OnClick").gameObject).onClick = BuySupporterPowerHint; Transform headClick = transform.Find("CharacterContainer/Live2dGraphic/Head"); Transform bodyClick = transform.Find("CharacterContainer/Live2dGraphic/Body"); PointerClickListener.Get(headClick.gameObject).onClick = Live2dClickTigger; PointerClickListener.Get(bodyClick.gameObject).onClick = Live2dClickTigger; SetLive2dClickSize(); HandleFunctionOpen(); _countDownTra = transform.Find("UserInfoView/CountDown"); PointerClickListener.Get(_countDownTra.gameObject).onClick = go => { GalaAccountManager.Instance.ShowWallVisitorView(); }; //CheckDownLoadQueue(); }