Ejemplo n.º 1
0
        //开始特写
        public void CloseupHorse(ETModel.Match.HorseRunData maxFightHorse)
        {
            HorseCloseUpUIComponent horseCloseUpUIComponent = new HorseCloseUpUIComponent();

            horseCloseUpUIComponent.ShowCloseUpUI(maxFightHorse, uiData);
            horseCloseUpUIComponent = null;
        }
Ejemplo n.º 2
0
        public void InitAllHorseHead()
        {
            for (int horseCount = 0; horseCount < horseList.Count; horseCount++)
            {
                var goTemplateRankInScene = GameObject.Instantiate <GameObject>(uiData.go_HeadInSceneTemplate);
                goTemplateRankInScene.transform.SetParent(uiData.go_AllHeadInSceneRoot.transform);
                goTemplateRankInScene.transform.localPosition    = Vector3.zero;
                goTemplateRankInScene.transform.localEulerAngles = Vector3.zero;
                goTemplateRankInScene.transform.localScale       = Vector3.one;
                goTemplateRankInScene.SetActive(true);
                RankingInSceneTemplateData rankingInSceneTemplateData = new RankingInSceneTemplateData();
                rankingInSceneTemplateData.InitUI(goTemplateRankInScene.transform);
                rankingInSceneTemplateData.image_SelectFlag.gameObject.SetActive(false);

                ETModel.Match.HorseRunData horseRunData = horseList[horseCount];
                bool isMy = (horseRunData.playerUid == myPlayerUID);
                rankingInSceneTemplateData.text_TextPlayerName.text  = horseRunData.playerNickname;
                rankingInSceneTemplateData.text_TextPlayerName.color = isMy ? myColor : whiteColor;

                string horseNameProcess = horseRunData.horseName;
                if (horseRunData.horseName.Contains("famousHorse__"))
                {
                    horseNameProcess = horseRunData.horseName.Substring(13);
                }
                rankingInSceneTemplateData.text_TextHorseName.text = horseNameProcess;

                horseHeadList.Add(rankingInSceneTemplateData);
                horseHeadObjList.Add(goTemplateRankInScene);
            }
        }
Ejemplo n.º 3
0
        private void ShowHeadPlayerNameAndHorseName(int horseIdx)
        {
            ETModel.Match.HorseRunData horseRunData = horseList[horseIdx];
            //马头上排名显示
            ModelHorseView findHorseView = battleModule.HorseRunDataID2ModelHorseViewSet[horseRunData.Id];

            if (findHorseView == null)
            {
                return;
            }

            RankingInSceneTemplateData rankData = horseHeadList[horseIdx];

            if (rankData == null || rankData.transform == null)
            {
                return;
            }

            bool isSelectHorse = (battleModule.currCameraHorseId == horseRunData.Id);
            bool isMy          = (horseRunData.playerUid == myPlayerUID);

            if (rankData.image_SelectFlag.gameObject.activeInHierarchy != isSelectHorse)
            {
                rankData.image_SelectFlag.gameObject.SetActive(isSelectHorse);
            }

            if (rankData.text_TextPlayerName.gameObject.activeInHierarchy != battleModule.isOpenHead)
            {
                rankData.text_TextPlayerName.gameObject.SetActive(battleModule.isOpenHead);
                rankData.text_TextHorseName.gameObject.SetActive(battleModule.isOpenHead);
            }

            //设置PlayerName位置
            Camera  currCamera          = gameRunRealCameraComponent.GetCurrRunCamera();
            Vector3 screenPosPlayerName = currCamera.WorldToScreenPoint(findHorseView.PlayerNamePointTrans.position);
            Vector3 posUIPlayerName     = battleModule.UICamera.ScreenToWorldPoint(screenPosPlayerName);
            Vector3 newPos = new Vector3(posUIPlayerName.x, posUIPlayerName.y + 0.4f, posUIPlayerName.z);

            rankData.image_SelectFlag.transform.position = newPos;

            if (battleModule.isOpenHead)
            {
                rankData.text_TextPlayerName.transform.position      = posUIPlayerName;
                rankData.text_TextPlayerName.transform.localPosition = new Vector3(rankData.text_TextPlayerName.transform.localPosition.x, rankData.text_TextPlayerName.transform.localPosition.y, 0);//设置z坐标为0
            }
        }