コード例 #1
0
    void AddItem(HexItemType type, HexCell cell)
    {
        HexItem item = Instantiate <HexItem>(HexItem.itemPrefab);

        item.itemType = type;
        grid.AddItem(item, cell);
    }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
0
    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;
        }
    }
コード例 #4
0
ファイル: HexUnit.cs プロジェクト: JCly-rikiu/Treasure-Hunter
 public void GetItem(HexItemType type)
 {
     ui.GetItem(type);
 }
コード例 #5
0
 void SendEffect(HexItemType type)
 {
     photonView.RPC("GetEffect", RpcTarget.Others, (int)type);
 }
コード例 #6
0
 void SendItem(HexItemType type, HexUnit unit)
 {
     photonView.RPC("GetItem", RpcTarget.Others, (int)type, (int)unit.Location.Index);
 }