summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/BarrageBehaviour.cs
blob: d3c7d92c6841952747add5f206da91e9b5338ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class BarrageBehaviour : DlgBehaviourBase
	{
		public Transform m_tranLeftBound;

		public Transform m_tranRightBound;

		public IXUILabel m_lblTpl;

		public GameObject m_objQueueTpl;

		public GameObject[] m_objQueue;

		public XUIPool m_pool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);

		private void Awake()
		{
			this.m_tranLeftBound = base.transform.Find("Bg/left");
			this.m_tranRightBound = base.transform.Find("Bg/right");
			this.m_lblTpl = (base.transform.Find("Bg/Text").GetComponent("XUILabel") as IXUILabel);
			this.m_objQueueTpl = base.transform.Find("Bg/queue").gameObject;
			this.m_pool.SetupPool(this.m_objQueueTpl.transform.parent.gameObject, this.m_objQueueTpl, 3u, true);
		}

		public void SetupPool()
		{
			this.m_objQueue = new GameObject[BarrageDlg.MAX_QUEUE_CNT];
			for (int i = 0; i < BarrageDlg.MAX_QUEUE_CNT; i++)
			{
				this.m_objQueue[i] = this.m_pool.FetchGameObject(false);
				this.m_objQueue[i].transform.localPosition = new Vector3(0f, (float)(320 - 40 * i), 0f);
			}
		}
	}
}