void AddItem(HexItemType type, HexCell cell) { HexItem item = Instantiate <HexItem>(HexItem.itemPrefab); item.itemType = type; grid.AddItem(item, cell); }
public void GetItem(HexItemType type) { if (type == HexItemType.FakeTreasureItem) { if (UIInfo.boxisFull == false) { UIInfo.boxisFull = true; Item newitem = Instantiate(items[0], slots[0].transform, false); newitem.hexcontroller = hexcontroller; } } else if (type == HexItemType.Change) { if (UIInfo.changeisFull == false) { UIInfo.changeisFull = true; Item newitem = Instantiate(items[1], slots[1].transform, false); newitem.hexcontroller = hexcontroller; } } else if (type == HexItemType.Poison) { if (UIInfo.poisonisFull == false) { UIInfo.poisonisFull = true; Item newitem = Instantiate(items[2], slots[2].transform, false); newitem.hexcontroller = hexcontroller; } } }
public void UseItem(HexItemType type) { switch (type) { case HexItemType.Poison: otherUnit.SpeedEffect(-20, 3); SendEffect(HexItemType.Poison); break; case HexItemType.FakeTreasureItem: AddItem(HexItemType.FakeTreasure, myUnit.Location); SendItem(HexItemType.FakeTreasure, myUnit); break; case HexItemType.Change: grid.changeUnits(); HexMapCamera.SetPosition(myUnit.Location); SendEffect(HexItemType.Change); break; } }
public void GetItem(HexItemType type) { ui.GetItem(type); }
void SendEffect(HexItemType type) { photonView.RPC("GetEffect", RpcTarget.Others, (int)type); }
void SendItem(HexItemType type, HexUnit unit) { photonView.RPC("GetItem", RpcTarget.Others, (int)type, (int)unit.Location.Index); }