Esempio n. 1
0
 public void Clear()
 {
     uiData = null;
     uIMatchSelfSkillLogic = null;
     myRunData             = null;
     battleModule          = null;
 }
Esempio n. 2
0
 public void Clear()
 {
     horse            = null;
     uIMatchRankLogic = null;
     matchItemData    = null;
     battleModule     = null;
 }
Esempio n. 3
0
        public void SetSkillInfo(ETModel.Match.HorseRunData horseRunData)
        {
            for (int i = 0; i < horseRunData.horseSkills.Count; i++)
            {
                int eachHorseSkill   = horseRunData.horseSkills[i];
                var horseSkillDefine = ModelComTools.Config.GetHorseSkillByID(eachHorseSkill);
                if (horseSkillDefine == null)
                {
                    continue;
                }

                if (horseSkillDefine.TriggerType == SkillTriggerType.OperationTrigger)
                {
                    if (horseSkillDefine.Trigger == SkillTriggerContent.AddSpeed)
                    {
                        opSkillItemComponentList[0].SetSkillInfo(eachHorseSkill, SkillTriggerContent.AddSpeed);
                    }
                    else if (horseSkillDefine.Trigger == SkillTriggerContent.Overtake)
                    {
                        opSkillItemComponentList[1].SetSkillInfo(eachHorseSkill, SkillTriggerContent.Overtake);
                    }
                    else if (horseSkillDefine.Trigger == SkillTriggerContent.Hinder)
                    {
                        opSkillItemComponentList[2].SetSkillInfo(eachHorseSkill, SkillTriggerContent.Hinder);
                    }
                }
            }
        }
Esempio n. 4
0
        public void Init(Transform transRoot)
        {
            battleModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            myRunData    = battleModule.myRunData;
            Log.Info("myRunData " + (myRunData == null));

            CDTime                = ModelComTools.Config.GetBaseByID(99005125).param1 / 1000f;
            transform             = transRoot;
            image_DirCountDown    = transform.Find("DirObj/DirCountDown").GetComponent <Image>();
            button_ButtonDirBtn0  = transform.Find("DirObj/DirBtn0").GetComponent <Button>();
            button_ButtonDirBtn1  = transform.Find("DirObj/DirBtn1").GetComponent <Button>();
            button_ButtonDirBtn2  = transform.Find("DirObj/DirBtn2").GetComponent <Button>();
            button_ButtonDirBtn3  = transform.Find("DirObj/DirBtn3").GetComponent <Button>();
            go_OpObj              = transform.Find("m_DirKeyGroup/m_DirList/OpObj").gameObject;
            go_DirBtnItemTemplate = transform.Find("m_DirKeyGroup/DirBtnItemTemplate").gameObject;
            go_SaoGuangEft        = transform.Find("m_DirKeyGroup/SaoGuangEft").gameObject;
            go_SaoGuangEft.SetActive(false);

            button_ButtonDirBtn0.onClick.AddListener(delegate() { OnButtonDirBtnClick("0"); });
            button_ButtonDirBtn1.onClick.AddListener(delegate() { OnButtonDirBtnClick("1"); });
            button_ButtonDirBtn2.onClick.AddListener(delegate() { OnButtonDirBtnClick("2"); });
            button_ButtonDirBtn3.onClick.AddListener(delegate() { OnButtonDirBtnClick("3"); });

            InitSkillId();
            InitDirList();
            transform.gameObject.SetActive(false);
        }
Esempio n. 5
0
 public void Release()
 {
     LongPressRelease();
     myRunData    = null;
     battleModule = null;
     uIMatchSelfSkillLogic.RemoveSelfSkill(skillId);
     uIMatchSelfSkillLogic = null;
 }
Esempio n. 6
0
 public void OnRefreshRankList()
 {
     for (int i = 0; i < horseList.Count; i++)
     {
         ETModel.Match.HorseRunData data = horseList[i];
         matchRankItemList[data.Rank].RefreshItem(data);
     }
 }
Esempio n. 7
0
 public void Clear()
 {
     if (timeCountDown != null)
     {
         timeCountDown.Dispose();
     }
     timeCountDown = null;
     uiData        = null;
     myRunData     = null;
     funcs         = null;
     matchModule   = null;
     battleModule  = null;
 }
Esempio n. 8
0
        public void Init(UIBattleMainData data)
        {
            matchModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            funcs       = matchModule.matchInit.funcs;
            myRunData   = matchModule.myRunData;
            uiData      = data;

            horseList      = funcs.GetHorses();
            preEnsureValue = 0;
            uiData.slider_SliderEnsure.value = 1f;
            diWidth  = uiData.recttrans_DyRank.rect.width;
            diHeight = uiData.recttrans_DyRank.rect.height;
            ShowDyRankList();
        }
Esempio n. 9
0
        public void Update()
        {
            curCDTime = curCDTime + Time.deltaTime;
            if (curCDTime >= cdTime)
            {
                curCDTime = cdTime - curCDTime;
                UpdateEnsureInfo();

                ETModel.Match.HorseRunData runData = null;
                double firstLen  = 0;         //第一名跑的路程
                double endLen    = 500000000; //最后一名跑的路程
                int    endPathId = 0;         //最外层的马所在的跑道
                for (int i = 0; i < horseList.Count; i++)
                {
                    runData = horseList[i];
                    if (runData.IsPassEnd)
                    {
                        continue;
                    }

                    double len = runData.GetAccLength();
                    if (len > firstLen)
                    {
                        firstLen = len;
                    }
                    if (len < endLen)
                    {
                        endLen = len;
                    }
                    if (runData.PathId > endPathId)
                    {
                        endPathId = runData.PathId;
                    }
                }
                double deltLen    = firstLen - endLen;
                float  percentage = (float)(endLen + deltLen * 0.5f) / matchModule.matchInfo.groundLength;
                if (percentage > 1)
                {
                    percentage = 1;
                }
                if (percentage < 0)
                {
                    percentage = 0;
                }
                for (int i = 0; i < matchRankItemList.Count; i++)
                {
                    matchRankItemList[i].Update(deltLen, endLen, percentage, endPathId);
                }
            }
        }
Esempio n. 10
0
        public void ShowCloseUpUI(ETModel.Match.HorseRunData selectedHorseData, UIBattleMainData uiMatchData)
        {
            GameObjectTool.TextOverFlowLimitWidth(uiMatchData.text_TextHorseName, selectedHorseData.horseName);
            //名马
            if (selectedHorseData.horseName.Contains("famousHorse__"))
            {
                GameObjectTool.TextOverFlowLimitWidth(uiMatchData.text_TextHorseName, selectedHorseData.horseName.Substring(13));
            }
            uiMatchData.text_TextPlayerName.text = selectedHorseData.playerNickname;
            uiMatchData.text_TextPower.text      = selectedHorseData.fightValue + "";
            uiMatchData.text_TextRoad.text       = string.Format("Track {0}", selectedHorseData.PathId + 1);

            var ancestryType = (GameObjectTool.AncestryType)ModelComTools.Config.GetAncestryByID(selectedHorseData.horseModleId).Type;

            GameObjectTool.LoadHorseIconByHorseClothes(uiMatchData.image_Horse.transform, selectedHorseData.clothesModel, ancestryType);
            uiMatchData.go_m_CloseUpInfo.SetActive(true);
        }
Esempio n. 11
0
        public void Clear()
        {
            if (opDirList != null)
            {
                opDirList.Clear();
            }
            opDirList = null;

            for (int i = 0; i < opDirObjList.Count; i++)
            {
                GameObject.DestroyImmediate(opDirObjList[i]);
            }
            opDirObjList.Clear();
            opDirObjList = null;

            myRunData    = null;
            battleModule = null;
        }
Esempio n. 12
0
        public void UpdateUIInfo(ETModel.Match.HorseRunData horsePar, float diWidthPar, float diHeightPar)
        {
            if (horsePar == null)
            {
                return;
            }

            horse    = horsePar;
            diWidth  = diWidthPar;
            diHeight = diHeightPar;

            bool isSelf = battleModule.isSelfPlayer(horse.playerUid);

            go_RankIconMy.SetActive(isSelf);
            image_RankIcon.sprite = GameObjectTool.LoadSprite("icon_hao" + (horse.Id + 1));

            float yPos = -diHeight * (horse.PathId / 13f);

            recttrans.localPosition = new Vector3(0, yPos, 0);
        }
Esempio n. 13
0
        public void RefreshItem(ETModel.Match.HorseRunData horse)//排名变化时动态刷新Item显示
        {
            this.horse = horse;
            //-------------------------
            //bool isFamousHorse = horse.horseName.Contains("famousHorse__"); //是否是名马
            //string horseName = isFamousHorse? horse.horseName.Substring(13): horse.playerNickname;
            //Eris 2021_10_19_17:15
            string horseName = horse.horseName;

            bool isSelf = battleModule.isSelfPlayer(horse.playerUid);

            matchItemData.image_Normal_iteminfo_bg.gameObject.SetActive(!isSelf);
            matchItemData.image_famousBg.gameObject.SetActive(isSelf);
            //if (isSelf)
            //{
            //    matchItemData.text_TextMatchItemRank_4.text = $"<color=#a7ff34>{horse.Rank + 1}</color>";
            //    matchItemData.text_TextMatchItemPlayer_6.text = $"<color=#a7ff34>{horseName}</color>";
            //}
            //else
            //{
            //    matchItemData.text_TextMatchItemRank_4.text = $"<color=white>{horse.Rank + 1}</color>";
            //    matchItemData.text_TextMatchItemPlayer_6.text = $"<color=white>{horseName}</color>";
            //}
            matchItemData.text_TextMatchItemPlayer_6.text = GameObjectTool.ShortenDisplayText(horseName, 15);//horseName;
            matchItemData.text_TextMatchItemRank_4.text   = (horse.Rank + 1) + string.Empty;
            matchItemData.image_haoIcon.sprite            = GameObjectTool.LoadSprite("icon_hao" + (horse.Id + 1));

            //if (horse.Rank < 3)
            //{
            //    matchItemData.image_RankPic.enabled = true;
            //    matchItemData.image_RankPic.sprite = GameObjectTool.LoadSprite("icon_Rank0" + horse.Rank);
            //    matchItemData.text_TextMatchItemRank_4.enabled = false;
            //}
            //else
            //{
            matchItemData.image_RankPic.enabled            = true;
            matchItemData.text_TextMatchItemRank_4.enabled = true;
            // }
            matchItemData.text_TextMatchItemPower_7.text = horse.fightValue + string.Empty;
            UpdateItemSelect();
        }
Esempio n. 14
0
        public void Clear()
        {
            for (int i = 0; i < matchRankItemList.Count; i++)
            {
                matchRankItemList[i].Clear();
            }
            matchRankItemList.Clear();
            matchRankItemList = null;

            for (int i = 0; i < matchRankItemObjList.Count; i++)
            {
                GameObject.DestroyImmediate(matchRankItemObjList[i]);
            }
            matchRankItemObjList.Clear();
            matchRankItemObjList = null;

            funcs       = null;
            uiData      = null;
            myRunData   = null;
            matchModule = null;
        }
Esempio n. 15
0
        public void Init(UIBattleMainData data)
        {
            matchModule  = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            battleModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            funcs        = matchModule.matchInit.funcs;
            myRunData    = matchModule.myRunData;
            uiData       = data;

            timeCountDown = ComponentFactory.Create <TimeCountDownComponent>();
            endPos        = funcs.GetEnd();
            SetMyPosTo2D();

            if (battleModule.IsPlayback)
            {
                uiData.recttrans_m_GroundState.localPosition -= new Vector3(52, 0, 0);
            }
            //preEnsureValue = 0;
            //preSpeedValue = 0;

            //uiData.slider_m_SpeedProgress.value = 1f;
            //uiData.slider_SliderEnsure.value = 1f;
            uiData.toggle_ToggleName.onValueChanged.AddListener(OnToggleSwitchHeadClick);
        }
Esempio n. 16
0
        public void InitUI(Transform transRoot)
        {
            battleModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            myRunData    = battleModule.myRunData;

            transform         = transRoot;
            image_EffectSkill = transform.Find("EffectSkill").GetComponent <Image>();
            image_BtnSkill    = transform.Find("BtnSkill").GetComponent <Image>();
            button_BtnSkill   = transform.Find("BtnSkill").GetComponent <Button>();
            image_FillSkill   = transform.Find("FillSkill").GetComponent <Image>();
            image_ProSkill    = transform.Find("ProSkill").GetComponent <Image>();
            text_CDSkill      = transform.Find("CDSkill").GetComponent <Text>();

            button_BtnSkill.onClick.Add(OnClickSkill);
            image_FillSkill.gameObject.SetActive(false);
            image_FillSkill.fillAmount = 1;
            image_ProSkill.gameObject.SetActive(false);
            image_ProSkill.fillAmount = 1;
            image_EffectSkill.gameObject.SetActive(true);

            text_CDSkill.gameObject.SetActive(false);
            beginCD = false;
        }
Esempio n. 17
0
        public void Init(Transform transRoot, UIMatchSelfSkillLogic uiParent, UIBattleMainData data)
        {
            battleModule          = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule;
            myRunData             = battleModule.myRunData;
            endPos                = battleModule.matchInit.funcs.GetEnd();
            uIMatchSelfSkillLogic = uiParent;
            uiData                = data;

            isInited       = false;
            transform      = transRoot;
            image_SkillBtn = transform.GetComponent <ButtonLongPress>();
            if (image_SkillBtn == null)
            {
                image_SkillBtn = transform.gameObject.AddComponent <ButtonLongPress>();
            }
            image_Background  = transform.Find("Background").GetComponent <Image>();
            image_Fill        = transform.Find("Fill").GetComponent <Image>();
            image_SkillIcon   = transform.Find("SkillIcon").GetComponent <Image>();
            image_SkillIconZZ = transform.Find("SkillIconZZ").GetComponent <Image>();
            text_SkillCD      = transform.Find("SkillCD").GetComponent <Text>();
            currTime          = 0f;

            AddEvent();
        }
Esempio n. 18
0
 public void Clear()
 {
     myRunData    = null;
     battleModule = null;
 }
Esempio n. 19
0
 public void Clear()
 {
     horse        = null;
     battleModule = null;
 }