34 lines
813 B
C#
34 lines
813 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
public class TombRaiderMapItem : MonoBehaviour {
|
|||
|
|
|||
|
private int objID; // 唯一标志
|
|||
|
public int ObjID
|
|||
|
{
|
|||
|
get { return objID; }
|
|||
|
}
|
|||
|
|
|||
|
private string itemID; // 素材名称
|
|||
|
public string ItemID
|
|||
|
{
|
|||
|
get { return itemID; }
|
|||
|
}
|
|||
|
|
|||
|
public Image itemImage; // item图标
|
|||
|
public RectTransform rt; // 控制位置
|
|||
|
|
|||
|
public void Show(int objID, string itemID, Vector2 pos)
|
|||
|
{
|
|||
|
transform.localScale = Vector3.one;
|
|||
|
gameObject.SetActive(true);
|
|||
|
this.objID = objID;
|
|||
|
this.itemID = itemID;
|
|||
|
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(itemImage, itemID);
|
|||
|
rt.anchoredPosition = pos;
|
|||
|
}
|
|||
|
}
|