private System.Random randomBySeed; //随机数 public void Init(Transform transParent) //只初始化一次UI数据 { battleModule = UtilsModuleManager.GetModule(ModuleType.MatchModule) as MatchModule; trans = transParent; recttrans = trans.gameObject.GetComponent <RectTransform>(); funcs = battleModule.matchInit.funcs; endPos = funcs.GetEnd(); randomBySeed = funcs.GetRandomBySeed(); go_RankIconMy = transParent.Find("RankIconMy").gameObject; image_RankIcon = transParent.Find("RankIcon").GetComponent <Image>(); }
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); }