protected virtual void OnInit() { if (templateRect == null) { if (CacheTransform.childCount > 0) { templateRect = CacheTransform.GetChild(0) as RectTransform; } } if (templateRect != null) { UGUITools.SetVisible(templateRect, false); } if (rowCount < 1) { rowCount = 1; } if (columnCount < 1) { columnCount = 1; } if (!NoScroll) { ScrollRect = UGUITools.SecureComponetInParent <ScrollRect>(CacheRectTransform); } if (ScrollRect != null) { ScrollRect.horizontal = !IsVertical; ScrollRect.vertical = IsVertical; } _Pool = new GNewPrivatePool <LayoutItem>(PoolSize); }
protected override void OnAwake() { base.OnAwake(); m_sp_prof = CacheTransform.Find("Content/Prof").GetComponent <UISprite>(); m_lab_lv = CacheTransform.Find("Content/Lv").GetComponent <UILabel>(); m_lab_name = CacheTransform.Find("Content/Name").GetComponent <UILabel>(); m_lab_fight = CacheTransform.Find("Content/Fight").GetComponent <UILabel>(); m_obj_agree = CacheTransform.Find("Content/BtnAgree").gameObject; if (null != m_obj_agree) { UIEventListener.Get(m_obj_agree).onClick = (obj) => { OnDealApply(true); }; } m_obj_refuse = CacheTransform.Find("Content/BtnRefuse").gameObject; if (null != m_obj_refuse) { UIEventListener.Get(m_obj_refuse).onClick = (obj) => { OnDealApply(false); }; } }
public override void Execute() { base.Execute(); if (Target == null) { this.mMoveDir = CacheTransform.forward; Vector3 dir = this.mMoveDir; dir.Normalize(); CacheTransform.position += dir * Time.deltaTime * mMoveSpeed; } else { if (Target.IsDead() || Target.IsStealth) { this.Release(); } else { Vector3 pos = Target.Pos + new Vector3(0, Target.Height / 2, 0); Quaternion to = Quaternion.LookRotation(pos - CacheTransform.position, Vector3.up); CacheTransform.rotation = Quaternion.Slerp(CacheTransform.rotation, to, Time.deltaTime * 4); CacheTransform.Translate(CacheTransform.forward * Time.deltaTime * this.mMoveSpeed); } } }
protected override void OnAwake() { base.OnAwake(); property = CacheTransform.Find("Content/Property").GetComponent <UILabel>(); propertyGrade = CacheTransform.Find("Content/GradeContent/Grade").GetComponent <UILabel>(); max = CacheTransform.Find("Content/Max"); }
protected override void OnAwake() { base.OnAwake(); m_lab_name = CacheTransform.Find("Content/Name").GetComponent <UILabel>(); m_checkmark = CacheTransform.Find("Content/Toggle/Checkmark").gameObject; m_sp_targetMark = CacheTransform.Find("Content/TargetMark").GetComponent <UISprite>(); }
public Transform GetSkeleton(string name) { if (_skeletonCache.ContainsKey(name)) { return(_skeletonCache[name]); } if (CacheTransform == null) { return(null); } var trans = CacheTransform.GetComponentsInChildren <Transform>(true); for (int i = 0; i < trans.Length; i++) { var node = trans[i]; if (node.name == name) { _skeletonCache.Add(name, node); return(node); } } _skeletonCache.Add(name, null); return(null); }
protected override void OnAwake() { base.OnAwake(); m_lab_name = CacheTransform.Find("Content/Name").GetComponent <UILabel>(); m_lab_num = CacheTransform.Find("Content/Num").GetComponent <UILabel>(); InitItemInfoGrid(CacheTransform.Find("Content/InfoGridRoot/InfoGrid")); }
protected override void OnInit(Camera UICamera) { FirstGameObject = CacheTransform.Find("BG/First").gameObject; CreatePlayerName = CacheTransform.Find("BG/First/Board/PlayerName").GetComponent <InputField>(); CreatePlayerInfoButton = CacheTransform.Find("BG/First/Board/Button").GetComponent <Button>(); #region Head HeadTransform = CacheTransform.Find("BG/Head").transform; HeadImage = HeadTransform.Find("HeadImage").GetComponent <Image>(); RoleName = HeadTransform.Find("RoleName").GetComponent <Text>(); RoleLV = HeadTransform.Find("RoleLV").GetComponent <Text>(); EXPSlider = HeadTransform.Find("RoleEXP").GetComponent <Slider>(); EXPText = HeadTransform.Find("RoleEXP/Text").GetComponent <Text>(); CoinNumText = HeadTransform.Find("Coinicon/Text").GetComponent <Text>(); CoinBuyButton = HeadTransform.Find("Coinicon/AddButton").GetComponent <Button>(); MialButton = HeadTransform.Find("MailButton").GetComponent <Button>(); PingText = HeadTransform.Find("Ping/Text").GetComponent <Text>(); FriendButton = HeadTransform.Find("Friend").GetComponent <Button>(); #endregion //ping // ip = Singleton<PhotonManager>.Instance.GetServerIP(); //ip = "115.239.211.112"; }
public override void OnDesignUpdate(UIDesignView view) { base.OnDesignUpdate(view); if (view.DesignRunTime == UIDesignView.UIDesignRunTime.None) { return; } float scaleX = 1; float scaleY = 1; float scaleZ = 1; if (view.DesignRunTime == UIDesignView.UIDesignRunTime.Height) { scaleY = CacheTransform.lossyScale.y; scaleZ = scaleX = scaleY; } else if (view.DesignRunTime == UIDesignView.UIDesignRunTime.Width) { scaleX = CacheTransform.lossyScale.x; scaleZ = scaleY = scaleX; } CacheTransform.localScale = new Vector3(scaleX / CacheTransform.lossyScale.x, scaleY / CacheTransform.lossyScale.y, scaleZ / CacheTransform.lossyScale.z); Panel.baseClipRegion = new Vector4(Panel.baseClipRegion.x / CacheTransform.localScale.x, Panel.baseClipRegion.y / CacheTransform.localScale.y , Panel.baseClipRegion.z / CacheTransform.localScale.x, Panel.baseClipRegion.w / CacheTransform.localScale.y); Panel.clipOffset = new Vector2(Panel.clipOffset.x / CacheTransform.localScale.x, Panel.clipOffset.y / CacheTransform.localScale.y); for (int i = 0; i < CacheTransform.childCount; i++) { CacheTransform.GetChild(i).localScale = new Vector3(1 / CacheTransform.localScale.x, 1 / CacheTransform.localScale.y, 1 / CacheTransform.localScale.z); } }
protected override void OnAwake() { base.OnAwake(); toggle = CacheTransform.GetComponent <UIToggle>(); label = CacheTransform.Find("Label").GetComponent <UILabel>(); warning = CacheTransform.Find("Warning").GetComponent <UISprite>(); }
//受け取った情報をもとに補間する private void LerpTransform() { Vector3 currentPos = CacheTransform.position; Vector3 targetPosition = recPosition; Quaternion targetRotation = recRotation; if (mode == Mode.Prediction) { float delay = (RecordableIdentityManager.progressTimeSinceStartup - prevReceiveTime) / 1000.0f; if (delay < 0.0f) { delay = 0.0f; } //通信遅延を想定した予測位置. targetPosition = recPosition + recVelocity * delay; } if (useTranslate) { CacheTransform.Translate(Vector3.Lerp(currentPos, targetPosition, positionLerp) - currentPos, Space.World); } else { CacheTransform.position = Vector3.Lerp(currentPos, targetPosition, positionLerp); } CacheTransform.rotation = Quaternion.Slerp(CacheTransform.rotation, recRotation, rotationLerp); }
protected override void OnAwake() { base.OnAwake(); name = CacheTransform.Find("BG/label").GetComponent <UILabel>(); readIcon = CacheTransform.Find("ICON/Toggle/read").GetComponent <UISprite>(); readedIcon = CacheTransform.Find("ICON/Toggle/readed").GetComponent <UISprite>(); }
protected override void OnAwake() { base.OnAwake(); m_ts_infoRoot = CacheTransform.Find("Content/InfoGridRoot/InfoGrid"); m_labBottomNum = CacheTransform.Find("Content/InfoGridRoot/BottomNum").GetComponent <UILabel>(); InitItemInfoGrid(m_ts_infoRoot); }
public void CacheAll() { properties.Clear(); Transform[] children = CacheTransform.GetComponentsInChildren <Transform>(true); for (int i = 0; i < children.Length; i++) { var childTransform = children[i]; if (childTransform != null) { var childName = childTransform.name; if (childName.StartsWith("Q_")) { var property = new Property(); property.Name = childName; property.GameObject = childTransform.gameObject; var components = new List <Component>(); for (int j = 0; j < serializeComponents.Count; j++) { var component = childTransform.GetComponent(serializeComponents[j]); if (component != null) { components.Add(component); } } property.Components = components; properties.Add(property); } } } }
protected override void OnAwake() { base.OnAwake(); InitItemInfoGrid(CacheTransform.Find("Content/InfoGridRoot/InfoGrid")); m_ts_none = CacheTransform.Find("Content/None"); mtsInfoRoot = CacheTransform.Find("Content/InfoGridRoot"); }
void UpdateDesign(UIDesignView view) { float scaleX = 1; float scaleY = 1; float scaleZ = 1; if (ScrollView.movement == UIScrollView.Movement.Vertical) { scaleY = CacheTransform.lossyScale.y; scaleZ = scaleX = scaleY; } else if (ScrollView.movement == UIScrollView.Movement.Horizontal) { scaleX = CacheTransform.lossyScale.x; scaleZ = scaleY = scaleX; } else { Debug.LogError("Unsupported UIScrollView Movement"); return; } CacheTransform.localScale = new Vector3(scaleX / CacheTransform.lossyScale.x, scaleY / CacheTransform.lossyScale.y, scaleZ / CacheTransform.lossyScale.z); Panel.baseClipRegion = new Vector4(Panel.baseClipRegion.x / CacheTransform.localScale.x, Panel.baseClipRegion.y / CacheTransform.localScale.y , Panel.baseClipRegion.z / CacheTransform.localScale.x, Panel.baseClipRegion.w / CacheTransform.localScale.y); Panel.clipOffset = new Vector2(Panel.clipOffset.x / CacheTransform.localScale.x, Panel.clipOffset.y / CacheTransform.localScale.y); for (int i = 0; i < CacheTransform.childCount; i++) { CacheTransform.GetChild(i).localScale = new Vector3(1 / CacheTransform.localScale.x, 1 / CacheTransform.localScale.y, 1 / CacheTransform.localScale.z); } }
protected override void OnAwake() { base.OnAwake(); m_lab_des = CacheTransform.Find("Content/Des").GetComponent <UIXmlRichText>(); //m_lab_times = CacheTransform.Find("Content/Times").GetComponent<UILabel>(); //m_reward = CacheTransform.Find("Content/RewardContent/Reward").GetComponent<UIGrid>(); m_lab_reward = CacheTransform.Find("Content/RewardContent/RewardTxt").GetComponent <UILabel>(); m_obj_accept = CacheTransform.Find("Content/Btns/BtnAccept").gameObject; m_typeLabel = CacheTransform.Find("Content/IconContent/IconBg/Label").GetComponent <UILabel>(); m_sprite_star = CacheTransform.Find("Content/star").GetComponent <UISprite>(); m_lblCount = CacheTransform.Find("Content/Times").GetComponent <UILabel>(); m_slider = CacheTransform.Find("Content/Times/Expslider").GetComponent <UISlider>(); m_rewardMultiple = CacheTransform.Find("Content/IconContent/mask/Label").GetComponent <UILabel>(); UIEventListener.Get(m_obj_accept).onClick = (obj) => { //DataManager.Manager<ClanManger>().AcceptClanTask(questInfo.ID); AcceptClanTask(); }; m_obj_inProgress = CacheTransform.Find("Content/Btns/BtnDoing").gameObject; UIEventListener.Get(m_obj_inProgress).onClick = (obj) => { //AutoMoveToTarget(); DoClanTask(); }; m_obj_submit = CacheTransform.Find("Content/Btns/BtnSubmit").gameObject; UIEventListener.Get(m_obj_submit).onClick = (obj) => { //DataManager.Manager<ClanManger>().FinishClanTask(questInfo.ID); FinishClanTask(); }; }
protected override void OnAwake() { base.OnAwake(); m_lab_name = CacheTransform.Find("Content/Title/TitleText").GetComponent <UILabel>(); m_lab_sw = CacheTransform.Find("Content/Get/GetSW/Value").GetComponent <UILabel>(); m_lab_zg = CacheTransform.Find("Content/Get/GetZG/Value").GetComponent <UILabel>(); m_lab_zj = CacheTransform.Find("Content/Get/GetZJ/Value").GetComponent <UILabel>(); m_lab_leftTimes = CacheTransform.Find("Content/Bottom/LeftTimes").GetComponent <UILabel>(); m_sp_donateIcon = CacheTransform.Find("Content/Bottom/Currency/Content/Icon").GetComponent <UISprite>(); m_lab_donateNum = CacheTransform.Find("Content/Bottom/Currency/Content/Num").GetComponent <UILabel>(); m_icon = CacheTransform.Find("Content/BG/BG").GetComponent <UISprite>(); m_obj_btnDonate = CacheTransform.Find("Content/Bottom/Donate").gameObject; headIcon = CacheTransform.Find("Content/headIcon"); if (null != m_obj_btnDonate) { UIEventListener.Get(m_obj_btnDonate).onClick = (obj) => { if (null != donateAction && null != m_data) { donateAction.Invoke(m_data.ID); } }; } m_trans_UIItemRewardGrid = CacheTransform.Find("Content/UIItemRewardGrid"); AddCreator(headIcon); }
protected override void OnInit(Camera UICamera) { base.OnInit(UICamera); LeftIcon = CacheTransform.Find("Content/LeftImage").GetComponent <Image>(); RightIcon = CacheTransform.Find("Content/RightImage").GetComponent <Image>(); LeftModel = CacheTransform.Find("Content/LeftModel"); RightModel = CacheTransform.Find("Content/RightModel"); ShowText = CacheTransform.Find("Content/ShowText").GetComponent <Text>(); TitleText = CacheTransform.Find("Content/TitleText").GetComponent <Text>(); for (int i = 0; i < 4; i++) { Answers[i] = CacheTransform.Find("Content/AnswerBtn" + (i + 1)).gameObject; EventTriggerListener.Get(Answers[i].gameObject).SetEventHandle(EnumTouchEventType.OnClick, (a, b, c) => { StopContentText(); string nextNode = NodeData.Answers[(int)(c[0])].Target; if (nextNode == "end") { //关闭界面 Singleton <WindowManager> .GetInstance().CloseWindow(false, "Dialogue"); return; } NodeData = GetDialogue(nextNode); Coroutine = SingletonMono <GameFrameWork> .GetInstance().StartCoroutine(ShowContentText()); }, i); } }
protected override void OnAwake() { base.OnAwake(); m_lab_event = CacheTransform.Find("Content/Event").GetComponent <UILabel>(); m_lab_name = CacheTransform.Find("Content/Name").GetComponent <UILabel>(); m_lab_time = CacheTransform.Find("Content/Time").GetComponent <UILabel>(); }
public void UpdateRenderer() { /* * * 1,2 1 * 1,2,3 1,2 */ var allActiveChildren = new List <Transform>(); for (var i = 0; i < CacheTransform.childCount; i++) { var childTf = CacheTransform.GetChild(i); if (childTf.gameObject.activeSelf) { allActiveChildren.Add(childTf); } } var positions = new Vector3[allActiveChildren.Count]; for (var i = 0; i < positions.Length; i++) { positions[i] = allActiveChildren[i].position; } mLineRenderer.positionCount = positions.Length; mLineRenderer.SetPositions(positions); }
protected override void OnAwake() { base.OnAwake(); m_lab_name = CacheTransform.Find("Content/FashionName").GetComponent <UILabel>(); m_sp_bg = CacheTransform.Find("Content/Bg").GetComponent <UISprite>(); m_high_bg = CacheTransform.Find("Content/hightbg").GetComponent <UISprite>(); if (m_high_bg != null) { m_high_bg.gameObject.SetActive(false); } m_sp_icon = CacheTransform.Find("Content/IconContent/IconBg/Icon").GetComponent <UITexture>(); m_obj_equipMark = CacheTransform.Find("Content/SignEquipped").gameObject; m_trans_priceContent = CacheTransform.Find("Content/Time/pricecontent").transform; if (m_trans_priceContent != null) { m_label_price = m_trans_priceContent.Find("pricelabel").GetComponent <UILabel>(); m_sprMoney = m_trans_priceContent.GetComponent <UISprite>(); } m_label_countdown = CacheTransform.Find("Content/Time/ContDown").GetComponent <UILabel>(); UIEventListener.Get(this.gameObject).onClick = (obj) => { OnBtnClicked(); }; }
public void InitPanelDetph() { if (null == m_lst_panels) { m_lst_panels = new List <UIPanel>(); List <UIDefine.UIPanelHierarchyData> panelHierarchyData = new List <UIDefine.UIPanelHierarchyData>(); UIPanel panel = CacheTransform.GetComponent <UIPanel>(); if (null != panel) { m_lst_panels.Add(panel); } UIPanelManager.GetPanelHierarchydepth(CacheTransform, 0, ref panelHierarchyData); if (panelHierarchyData.Count > 0) { panelHierarchyData.Sort((left, right) => { return(left.hierachyDepth - right.hierachyDepth); }); for (int i = 0; i < panelHierarchyData.Count; i++) { m_lst_panels.Add(panelHierarchyData[i].panel); } } } }
protected override void OnAwake() { base.OnAwake(); m_spriteBg = CacheTransform.Find("Texture").GetComponent <UITexture>(); m_lableCost = CacheTransform.Find("Cost/Cost_label").GetComponent <UILabel>(); m_lableName = CacheTransform.Find("value").GetComponent <UILabel>(); m_spriteIcon = CacheTransform.Find("Cost/Icon").GetComponent <UISprite>(); }
protected override void OnAwake() { base.OnAwake(); m_spIcon = CacheTransform.Find("Content/Icon").GetComponent <UISpriteEx>(); m_ts = CacheTransform.GetComponent <TweenScale>(); m_tsSelectMask = CacheTransform.Find("Content/SelectMask"); SetTriggerEffect(false); }
protected override void OnAwake() { base.OnAwake(); name = CacheTransform.Find("name").GetComponent <UILabel>(); JinXingZhong = CacheTransform.Find("JinXingZhong").GetComponent <UILabel>(); WeiKaiQi = CacheTransform.Find("WeiKaiQi").GetComponent <UILabel>(); icon = CacheTransform.Find("icon").GetComponent <UISprite>(); }
protected override void OnAwake() { base.OnAwake(); InitItemInfoGrid(CacheTransform.Find("Content/InfoGridRoot/InfoGrid")); }
/// <summary> /// 初始化UI位置与大小(拉伸铺满) /// </summary> public void InitUIRect(Transform parent) { CacheTransform.SetParent(parent); CacheRectTransform.anchoredPosition = Vector2.zero; CacheRectTransform.sizeDelta = Vector2.zero; CacheRectTransform.localScale = Vector3.one; }
/// <summary> /// 初始化UI位置与大小 /// </summary> public void InitUIRect(Transform parent, Vector2 pos, Vector2 size) { CacheTransform.SetParent(parent); CacheRectTransform.anchoredPosition = pos; CacheRectTransform.sizeDelta = size; CacheRectTransform.localScale = Vector3.one; }
protected override void OnAwake() { base.OnAwake(); name = CacheTransform.Find("Content/Name").GetComponent <UILabel>(); des = CacheTransform.Find("Content/Des").GetComponent <UILabel>(); m_spr_redPoint = CacheTransform.Find("Content/redPoint").GetComponent <UISprite>(); InitItemInfoGrid(CacheTransform.Find("Content/InfoGridRoot/InfoGrid")); }