예제 #1
0
	bool SetPlayerInfo(Def_Promotion.eCondition _condition)
	{
		m_Player = AsUserInfo.Instance.GetCurrentUserEntity();
		
		if(m_Player != null)
		{
			Tbl_Promotion_Table promotionTable = AsTableManager.Instance.GetTbl_PromotionTable();
			
			eCLASS __class = m_Player.GetProperty<eCLASS>(eComponentProperty.CLASS);
			
			if(promotionTable != null)
			{
				MultiDictionary<Def_Promotion.eCondition, Tbl_Promotion_Record> mdicRecords = promotionTable.GetRecordsByClass(__class);
				if(mdicRecords != null)
				{
					List<Tbl_Promotion_Record> listRecord = mdicRecords[_condition];
					
					if(listRecord.Count == 0)
					{
						Debug.LogWarning("AsPromotionManager::SetPlayerInfo: no conditioned record. check promotion table. __class = " + __class);
						return false;
					}
					
					m_Record = null;
					foreach(Tbl_Promotion_Record node in listRecord)
					{
						if(node.CheckValidLevel(m_Player.GetProperty<int>(eComponentProperty.LEVEL)) == true)
						{
							if(m_Record == null || node.Priority < m_Record.Priority )
								m_Record = node;
						}
					}
					
					if(m_Record != null)
						return true;
					else
						return false;
				}
				else
				{
					Debug.LogWarning("AsPromotionManager::SetPlayerInfo: no classified records. __class = " + __class);
					return false;
				}
			}
			else
			{
				Debug.LogError("AsPromotionManager::SetPlayerInfo: promotionTable is null. AsGameMain.s_gameState = " + AsGameMain.s_gameState);
				return false;
			}
		}
		else
		{
			Debug.LogError("AsPromotionManager::SetPlayerInfo: player entity is null. AsGameMain.s_gameState = " + AsGameMain.s_gameState);
			return false;
		}
	}
예제 #2
0
	public void Init(Tbl_Promotion_Record _record)
	{
		m_Record = _record;
		
		m_FadeInTime = AsTableManager.Instance.GetTbl_GlobalWeight_Record(101).Value * 0.001f;
		m_PromotionTime = _record.PromotionTime * 0.001f;
		m_FadeOutTime = AsTableManager.Instance.GetTbl_GlobalWeight_Record(102).Value * 0.001f;
		
		Item item = ItemMgr.ItemManagement.GetItem(_record.Item_Index);
		
		// icon
		GameObject obj = Instantiate(item.GetIcon()) as GameObject;
		UISlotItem slot = obj.GetComponent<UISlotItem>();
		SimpleSprite sprite = slot.iconImg;
		sprite.transform.parent = m_spSlot.transform;
		sprite.transform.localPosition = new Vector3(0f, 0f, -0.1f);
		Destroy(m_spIcon.gameObject);
//		sprite.transform.position = m_spIcon.transform.position;
//		sprite.transform.rotation = m_spIcon.transform.rotation;
//		Destroy(m_spIcon.gameObject);
//		m_spIcon.gameObject.SetActiveRecursively(false);
//		sprite.transform.parent = m_spIcon.transform;
//		sprite.transform.position = Vector3.zero;
//		sprite.transform.rotation = Quaternion.identity;
		m_spIcon = sprite;
		
		string name = AsTableManager.Instance.GetTbl_String(item.ItemData.nameId);
		string str = AsTableManager.Instance.GetTbl_String(_record.String_Index);
		string buttonStr = AsTableManager.Instance.GetTbl_String(1769);
		
		m_textTitle.Text = name;
		m_textIndex.Text = str;		
		m_btnBuy.Text = buttonStr;
		
		// alpha
		SetAlpha(0f);
		
		m_btnBuy.SetInputDelegate(OnBuyBtnClicked_Del);
		m_spPromotion.GetComponent<AsPromotionBtn_Cancel>().SetInput_Del(OnCancelClicked_Del);
	}
예제 #3
0
	public override void LoadTable( string _path)
	{
		try
		{
			XmlElement root = GetXmlRootElement( _path);
			XmlNodeList nodes = root.ChildNodes;

//			List<char> listChar = new List<char>();
			foreach( XmlNode node in nodes)
			{
				Tbl_Promotion_Record record = new Tbl_Promotion_Record( (XmlElement)node);
				m_ResourceTable.Add( record.Index, record);

				if( m_dmdicCondition.ContainsKey( record.Class) == false)
					m_dmdicCondition.Add( record.Class, new MultiDictionary<Def_Promotion.eCondition, Tbl_Promotion_Record>());

				m_dmdicCondition[record.Class].Add( record.Condition, record);
			}
		}
		catch( System.Exception e)
		{
			Debug.LogError( e);
		}
	}