public void SetAgent(GoapAgent goapAgent) { this.goapAgent = goapAgent; Transform hpTarget = ToolsComponent.FindChildCom <Transform>(goapAgent.transform, "Hp"); follow.SetTarget(hpTarget); }
protected override void GetView() { follow = ToolsComponent.GetComponent <Follow>(transform); hpSlider = ToolsComponent.FindChildCom <HpSlider>(transform, "HpSlider"); textItem = ToolsComponent.FindChildCom <Transform>(transform, "HpText"); }
private Transform GetHpTransform(GoapAgent goapAgent) { string hpName = string.Format("Hp{0}", Enum.GetName(typeof(Camp), goapAgent.Camp)); if (!hpQueueDic.ContainsKey(hpName)) { hpQueueDic[hpName] = new Queue <Transform>(); } Transform hpTr = null; if (hpQueueDic[hpName].Count <= 0) { GameObject newHpGo = Instantiate(hpDic[hpName].gameObject) as GameObject; newHpGo.name = hpName; hpTr = newHpGo.transform; ToolsComponent.AddChild(transform, hpTr); hpTr.position = new Vector3(0, 1000, 0); } else { hpTr = hpQueueDic[hpName].Dequeue(); } return(hpTr); }
public void Init() { m_bg = ToolsComponent.FindChildCom <Transform>(m_tr, "BG"); m_UidInputField = ToolsComponent.FindChildCom <InputField>(m_tr, "BG/UidInputField"); m_loginButton = ToolsComponent.FindChildCom <Button>(m_tr, "BG/LoginButton"); m_clearButton = ToolsComponent.FindChildCom <Button>(m_tr, "BG/ClearButton"); m_languageDropDown = ToolsComponent.FindChildCom <Dropdown>(m_tr, "BG/LanguageDropdown"); m_serverDropDown = ToolsComponent.FindChildCom <Dropdown>(m_tr, "BG/ServerDropdown"); }
protected override void GetView() { for (int i = 0; i < hpNames.Length; ++i) { Transform hpTr = ToolsComponent.FindChildCom <Transform>(transform, hpNames[i]); if (hpTr != null) { hpDic[hpNames[i]] = hpTr; } } }
public Transform GetPanel(string panelName) { Transform panel = null; if (m_otherPanelDic.TryGetValue(panelName, out panel)) { return(panel); } panel = ToolsComponent.FindChildCom <Transform>(m_tr, panelName); return(panel); }
private HpText GetText() { if (hpTextQueue.Count > 0) { return(hpTextQueue.Dequeue()); } if (textItem == null) { return(null); } Transform item = ToolsComponent.CloneItem(transform, textItem); HpText hpText = item.GetComponent <HpText>(); hpText.SetHp(this); return(hpText); }
protected virtual void Awake() { // 获取 UI m_Tr = transform; m_closeBtn = ToolsComponent.FindChildCom <Button>(m_Tr, "Close"); if (m_closeBtn != null) { m_closeBtn.onClick.AddListener(CloseOnClick); } GetView(); State |= UIPanelState.InitialUI; if (isRootPanel) { SetData(-1, null); } }
// Use this for initialization void Start() { slider = ToolsComponent.FindChildCom <Slider>(transform, "Slider"); }
private void GetUICamera() { m_uiCamera = ToolsComponent.FindChildCom <Camera>(m_tr, "Camera"); m_rootPanel = ToolsComponent.FindChildCom <Transform>(m_tr, "RootPanel"); }