本文整理汇总了C#中ItemInfo类的典型用法代码示例。如果您正苦于以下问题:C# ItemInfo类的具体用法?C# ItemInfo怎么用?C# ItemInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemInfo类属于命名空间,在下文中一共展示了ItemInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Refresh
public void Refresh(ItemInfo info, ItemInfo parentInfo, bool ifEnough = false)
{
if (ifEnough)
{
this.mListPanel.CheckIfEnough(info);
}
else
{
this.mListPanel.Refresh(info, parentInfo);
if (Globals.Instance.AttDB.AwakeRecipeDict.GetInfo(info.ID) == null)
{
this.mCreateInfoLayer.gameObject.SetActive(false);
this.mSourceInfoLayer.gameObject.SetActive(true);
this.mSourceBG.enabled = true;
this.mSourceInfoLayer.Refresh(info);
}
else
{
this.mCreateInfoLayer.gameObject.SetActive(true);
this.mSourceInfoLayer.gameObject.SetActive(false);
this.mSourceBG.enabled = false;
this.mCreateInfoLayer.Refresh(info, parentInfo);
}
}
}
示例2: AddItem
public void AddItem()
{
if (this.bAddAble == false) return;
//셋팅된 정보대로 ItemInfo 를 만든다.
ItemInfo newItemInfo = new ItemInfo();
newItemInfo.name = inputName.value; //입력된 이름
if (inputPopup.value.CompareTo("Type0") == 0 )
newItemInfo.type = 0;
else if (inputPopup.value.CompareTo("Type1") == 0)
newItemInfo.type = 1;
else if (inputPopup.value.CompareTo("Type2") == 0)
newItemInfo.type = 2;
this.itemList.AddItem(newItemInfo);
//한번 추가된 이후로 중복 추가 안되게.
this.bAddAble = false;
}
示例3: CommonSourceItemData
public CommonSourceItemData(int sceneID, ItemInfo itemInfo, ulong index)
{
this.mSourceType = EItemSource.EISource_SceneLoot;
this.mSceneID = sceneID;
this.mItemInfo = itemInfo;
this.id = index;
}
示例4: FindClosestTreeInRadius
public static bool FindClosestTreeInRadius(Vector3D fromPosition, float radius, out ItemInfo result)
{
result = default(ItemInfo);
BoundingSphereD sphere = new BoundingSphereD(fromPosition, (double)radius);
var entities = MyEntities.GetEntitiesInSphere(ref sphere);
double closestDistanceSq = double.MaxValue;
foreach (MyEntity entity in entities)
{
MyTrees trees = entity as MyTrees;
if (trees == null) continue;
trees.GetPhysicalItemsInRadius(fromPosition, radius, m_tmpEnvItemList);
foreach (var tree in m_tmpEnvItemList)
{
double distanceSq = Vector3D.DistanceSquared(fromPosition, tree.Transform.Position);
if (distanceSq < closestDistanceSq)
{
result.ItemsEntityId = entity.EntityId;
result.ItemId = tree.LocalId;
result.Target = tree.Transform.Position;
closestDistanceSq = distanceSq;
}
}
}
entities.Clear();
return closestDistanceSq != double.MaxValue;
}
示例5: ItemUsedOnBlock
private void ItemUsedOnBlock(World world, Coordinates3D coordinates, BlockFace face, Coordinates3D cursor, ItemInfo item)
{
var info = world.GetBlockInfo(coordinates);
if (Block.GetIsSolidOnFace(info, face) == false)
return;
coordinates += MathHelper.BlockFaceToCoordinates(face);
switch (face)
{
case BlockFace.NegativeZ:
world.SetBlockId(coordinates, item.ItemId);
world.SetMetadata(coordinates, (byte)Orientation.FacingNorth);
break;
case BlockFace.PositiveZ:
world.SetBlockId(coordinates, item.ItemId);
world.SetMetadata(coordinates, (byte)Orientation.FacingSouth);
break;
case BlockFace.NegativeX:
world.SetBlockId(coordinates, item.ItemId);
world.SetMetadata(coordinates, (byte)Orientation.FacingWest);
break;
case BlockFace.PositiveX:
world.SetBlockId(coordinates, item.ItemId);
world.SetMetadata(coordinates, (byte)Orientation.FacingEast);
break;
default:
// Ladders can't be placed lying flat.
break;
}
}
示例6: Init
public void Init(ItemInfo itemInfo)
{
BagIndex = itemInfo.BagIndex;
Quality = ItemModeLocator.Instance.GetQuality(itemInfo.TmplId);
DateTime expireTime = Utils.ConvertFromJavaTimestamp(itemInfo.ExpireTime);
TimeRemain = expireTime.Subtract(DateTime.Now);
}
示例7: Item
public Item(int id, bool isEqueped, ItemInfo info)
{
this.id = id;
this.count = 1;
this.info = info;
this.isEqueped = isEqueped;
}
示例8: Refresh
public void Refresh(PetInfo petInfo, int curPetCount, int needPetCount)
{
this.mItemInfo = null;
this.mPetInfo = petInfo;
this.mLopetInfo = null;
this.IsEnough = (curPetCount >= needPetCount);
if (petInfo != null)
{
this.mIcon.gameObject.SetActive(true);
this.mQualityMask.gameObject.SetActive(true);
this.mIcon.spriteName = petInfo.Icon;
this.mQualityMask.spriteName = Tools.GetItemQualityIcon(petInfo.Quality);
}
else
{
this.mIcon.gameObject.SetActive(false);
this.mQualityMask.gameObject.SetActive(false);
}
this.mSb.Remove(0, this.mSb.Length);
if (curPetCount < needPetCount)
{
this.mSb.Append("[ff0000]");
}
else
{
this.mSb.Append("[ffffff]");
}
this.mSb.Append(curPetCount).Append("[-]/").Append(needPetCount);
this.mNum.text = this.mSb.ToString();
}
示例9: GUITrialRewardItemData
public GUITrialRewardItemData(ERewardType et, ItemInfo iInfo, int num, int dNum)
{
this.mERewardType = et;
this.mItemInfo = iInfo;
this.mItemNum = num;
this.mDaiBiNum = dNum;
}
示例10: Refresh
public void Refresh(ItemInfo itemInfo, bool isMask)
{
this.mPetInfo = null;
this.mItemInfo = itemInfo;
this.mIsActive = isMask;
this.Refresh();
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string key = core.Http["key"];
try
{
ItemInfo info = new ItemInfo(core, key);
// about to redirect, preserve the referer
string urlreferer = Request.QueryString["urlreferer"];
if (!string.IsNullOrEmpty(urlreferer))
{
// update the session record
db.UpdateQuery(string.Format("UPDATE user_sessions SET session_http_referer = '{2}' WHERE session_string = '{1}' AND session_ip = '{0}';",
core.Session.IPAddress.ToString(), core.Session.SessionId, urlreferer));
}
core.Http.StatusCode = 301;
core.Http.ForceDomain = true;
core.Http.Redirect(info.Uri);
}
catch (InvalidIteminfoException)
{
core.Functions.Generate404();
}
/*catch
{
core.Functions.Generate404();
}*/
}
示例12: Refresh
private void Refresh()
{
if (this.mLootData != null)
{
if (this.mLootData.RewardType == 1)
{
this.mItemIcon.spriteName = "M101";
this.mItemQuality.spriteName = Tools.GetItemQualityIcon(0);
this.mItemNum.text = this.mLootData.RewardValue1.ToString();
this.mItemInfo = null;
}
else if (this.mLootData.RewardType == 2)
{
this.mItemIcon.spriteName = "M102";
this.mItemQuality.spriteName = Tools.GetItemQualityIcon(2);
this.mItemNum.text = this.mLootData.RewardValue1.ToString();
this.mItemInfo = null;
}
else if (this.mLootData.RewardType == 3)
{
this.mItemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.mLootData.RewardValue1);
if (this.mItemInfo != null)
{
this.mItemIcon.spriteName = this.mItemInfo.Icon;
this.mItemQuality.spriteName = Tools.GetItemQualityIcon(this.mItemInfo.Quality);
this.mItemNum.text = this.mLootData.RewardValue2.ToString();
}
}
}
}
示例13: Init
public void Init(ItemInfo info, int num, bool showValue, bool showTips)
{
this.itemInfo = info;
this.count = num;
this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
if (this.petInfo == null)
{
global::Debug.LogError(new object[]
{
string.Format("PetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
});
base.gameObject.SetActive(false);
return;
}
UISprite component = base.GetComponent<UISprite>();
component.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
UISprite uISprite = GameUITools.FindUISprite("icon", base.gameObject);
uISprite.spriteName = this.petInfo.Icon;
UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
if (showValue)
{
uILabel.text = this.count.ToString();
}
else
{
uILabel.gameObject.SetActive(false);
}
if (showTips)
{
UIEventListener expr_FD = UIEventListener.Get(base.gameObject);
expr_FD.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_FD.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick));
}
}
示例14: Init
private void Init(ItemInfo info, int num)
{
if (info.Type != 3 || info.SubType != 3)
{
global::Debug.LogErrorFormat("Use reward type error {0}", new object[]
{
(EItemType)info.Type
});
base.gameObject.SetActive(false);
return;
}
this.itemInfo = info;
this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2);
if (this.lopetInfo == null)
{
global::Debug.LogError(new object[]
{
string.Format("LopetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
});
base.gameObject.SetActive(false);
return;
}
UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject);
uISprite.spriteName = Tools.GetItemQualityIcon(this.lopetInfo.Quality);
UISprite component = base.GetComponent<UISprite>();
component.spriteName = this.lopetInfo.Icon;
UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.lopetInfo.Quality), this.itemInfo.Name, num);
}
示例15: OnGUI
void OnGUI()
{
m_Type = (ItemType)EditorGUILayout.EnumPopup("Item Type", m_Type);
m_strName = EditorGUILayout.TextField("Name", m_strName);
m_strDescription = EditorGUILayout.TextField("Description", m_strDescription);
ScriptableObject target = this;
SerializedObject so = new SerializedObject(target);
SerializedProperty sp_picNames = so.FindProperty("m_strPicNames");
SerializedProperty sp_childItems = so.FindProperty("m_iChildItems");
EditorGUILayout.PropertyField(sp_picNames, true);
EditorGUILayout.PropertyField(sp_childItems, true);
so.ApplyModifiedProperties();
if (GUILayout.Button("Create"))
{
ItemInfo info = new ItemInfo();
info.m_iID = 0;
info.m_Type = m_Type;
info.m_strName = m_strName;
info.m_strDescription = m_strDescription;
info.m_iPhotoIDs = m_iPhotoIDs;
info.m_iChildIDs = m_iChildIDs;
WriteItemInfo(info);
}
}