Esempio n. 1
0
 public void Destory()
 {
     if (MapCard != null)
     {
         MapCard.Destory();
     }
 }
Esempio n. 2
0
 // this function is used to compare that if one of the teamMember has the function same with the win condition
 void  compare(resourceCard teamMember, MapCard map)
 {
     if (teamMember.function1 == map.winCondition1)
     {
         if (winCondition1Signal == 0)          // this kind of signal is to avoid the re-calculate of the match number, when there is more than one function of the same kind
         {
             matchNum++;
             winCondition1Signal = 1;
         }
     }
     if (teamMember.function1 == map.winCondition2)
     {
         if (winCondition2Signal == 0)
         {
             matchNum++;
             winCondition2Signal = 1;
         }
     }
     if (teamMember.function1 == map.winCondition3)
     {
         if (winCondition3Signal == 0)
         {
             matchNum++;
             winCondition3Signal = 1;
         }
     }
     // function 2 of the team member
     if (teamMember.function2 == map.winCondition1)
     {
         if (winCondition1Signal == 0)
         {
             matchNum++;
             winCondition1Signal = 1;
         }
     }
     if (teamMember.function2 == map.winCondition2)
     {
         if (winCondition2Signal == 0)
         {
             matchNum++;
             winCondition2Signal = 1;
         }
     }
     if (teamMember.function2 == map.winCondition3)
     {
         if (winCondition3Signal == 0)
         {
             matchNum++;
             winCondition3Signal = 1;
         }
     }
 }
Esempio n. 3
0
    /// <summary>
    /// 发牌
    /// </summary>
    /// <param name="end"></param>
    private void Deal(Vector3 end)
    {
        GameObject go    = Instantiate <GameObject>(mCard, new Vector3(20, 20, 0), Quaternion.identity);
        int        index = UnityEngine.Random.Range(0, GameDate.pileList.Count);
        MapC       mapC  = GameDate.pileList[index];

        GameDate.pileList.RemoveAt(index);
        MapCard mapCard = go.GetComponent <MapCard>();

        mapCard.Name   = mapC.name;
        mapCard.Sprite = Resources.Load <Sprite>("img/" + mapC.imagePath);
        mapCard.Nature = mapC.nature;
        Tweener tweener = go.transform.DOMove(end, 2f);

        tweener.OnComplete(() => { GameDate.isPlay = false; });
    }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (situationData.stopSignal == 1)
     {
         if (whichMap == GameSetup.mapcardNum)            //Add a catch, if at the end of the array, the game is over early, you lose
         {
             print("You Lose");
         }
         else                                            //Pull from that room card array from GameSetup.cs to find the next card
         {
             print("You are going to draw a room");
             nowMap = GameSetup.MapArray[whichMap];
             print(nowMap.hiddenScription);
             whichMap++;
         }
     }
 }
    public void SelectMap(MapCard mapCard)
    {
        _selectedMapIndex = mapCards.IndexOf(mapCard);

        DeselectOtherMaps();
    }