public void Init( AsDelegateImageDlgItem parent, DelegateImageData imageData)
	{
//		parentItem = parent;
		
		switch( imageData.eSubType)
		{
		case eDelegateImageSubType.Gold:
			msg.Text = string.Format( AsTableManager.Instance.GetTbl_String(4080), imageData.unlockCost.ToString( "#,#0", CultureInfo.InvariantCulture));
			break;
		case eDelegateImageSubType.Miracle:
			msg.Text = string.Format( AsTableManager.Instance.GetTbl_String(4079), imageData.unlockCost.ToString( "#,#0", CultureInfo.InvariantCulture));
			break;

		default:
			msg.Text = "";
			break;
		}
		
		StringBuilder sb = new StringBuilder( "UIPatchResources/DelegateImage/");
		sb.Append( imageData.iconName);
		Texture2D tex = ResourceLoad.Loadtexture( sb.ToString()) as Texture2D;
		image.SetTexture( tex);
		image.SetUVsFromPixelCoords( new Rect( 0.0f, 0.0f, tex.width, tex.height));
		
		stat.Text = AsTableManager.Instance.GetTbl_String( imageData.idEffectDescription );
	}
	public void Init( DelegateImageData imageData , int _nSlot )
	{
		switch( imageData.eSubType)
		{
		case eDelegateImageSubType.Item:
			msg.Text = AsTableManager.Instance.GetTbl_String(2711);
			break;
		}
		
		StringBuilder sb = new StringBuilder( "UIPatchResources/DelegateImage/");
		sb.Append( imageData.iconName);
		Texture2D tex = ResourceLoad.Loadtexture( sb.ToString()) as Texture2D;
		image.SetTexture( tex);
		image.SetUVsFromPixelCoords( new Rect( 0.0f, 0.0f, tex.width, tex.height));
		
		stat.Text = AsTableManager.Instance.GetTbl_String( imageData.idEffectDescription );

		m_nSlot = _nSlot;
	}
Пример #3
0
	private void DelegateImageStatDlg( DelegateImageData data )
	{
		if( confirmDlg != null )
			Destroy( confirmDlg.gameObject);
		
		if( null != statDlg)
			Destroy( statDlg.gameObject);
		
		statDlg = GameObject.Instantiate( ResourceLoad.LoadGameObject( "UI/Optimization/Prefab/DelegateImageInfo")) as GameObject;
		Debug.Assert( null != statDlg);
		AsDelegateImageStatDlg dlg = statDlg.GetComponent<AsDelegateImageStatDlg>();
		Debug.Assert( null != dlg);
		dlg.Init( data);
	}
Пример #4
0
	private void PromptConfirmDlg( DelegateImageData data)
	{
		if( false == data.locked)
			return;
		
		if( statDlg != null )
			Destroy( statDlg.gameObject);
		
		if( null != confirmDlg)
			Destroy( confirmDlg.gameObject);
		
		confirmDlg = GameObject.Instantiate( ResourceLoad.LoadGameObject( "UI/Optimization/Prefab/DelegateImageConfirm")) as GameObject;
		Debug.Assert( null != confirmDlg);
		AsDelegateImageConfirmDlg dlg = confirmDlg.GetComponent<AsDelegateImageConfirmDlg>();
		Debug.Assert( null != dlg);
		dlg.Init( this, data);
	}
Пример #5
0
	public void LoadTable()
	{
		try
		{
			XmlElement root = AsTableBase.GetXmlRootElement( "Table/ImageTable");
			XmlNodeList nodes = root.ChildNodes;

			foreach( XmlNode node in nodes)
			{
				DelegateImageData imageData = new DelegateImageData( (XmlElement)node);
				
				switch( imageData.eType)
				{
				case eDelegateImageType.Normal:
					{
						if( true == dicGeneralDelegate.ContainsKey( imageData.id))
						{
							Debug.LogError( "already exist : " + imageData.id);
							continue;
						}
						
						imageData.locked = ( eDelegateImageSubType.None == imageData.eSubType) ? false : true;
						dicGeneralDelegate.Add( imageData.id, imageData);
					}
					break;
				case eDelegateImageType.Rare:
					{
						if( true == dicRareDelegate.ContainsKey( imageData.id))
						{
							Debug.LogError( "already exist : " + imageData.id);
							continue;
						}
						
						dicRareDelegate.Add( imageData.id, imageData);
					}
					break;
				default:
					Debug.LogError( "Invalid image type : " + imageData.eType);
					break;
				}
			}
		}
		catch( System.Exception e)
		{
			Debug.LogError(e);
			AsUtil.ShutDown( "AsDelegateImageManager:LoadTable");
		}
	}