예제 #1
0
 public void onClick()
 {
     if (HexGM.isShoppingRound())
     {
         if (unit != null)
         {
             if (GameObject.ReferenceEquals(player.activeUnitObject, this.gameObject))
             {
                 // deselect
                 player.clearActiveUnit();
                 this.gameObject.GetComponent <Image>().color = unit.getTierColor();
             }
             else
             {
                 player.SetActiveUnit(unit, this.gameObject);
                 player.rgo = new Player.ResetGameObject(resetDefault);
             }
         }
         else if (player.getActiveUnit() != null)
         {
             ally.checkBoardForThreeUnits(player.getActiveUnit());
             setUnit(player.getActiveUnit());
             player.clearActiveUnit();
             player.rgo();
             supply.setCurrentSupply(ally.getTotalActiveUnits());
         }
     }
 }
예제 #2
0
 public void takeDamage(Unit attacker)
 {
     if (!HexGM.isShoppingRound() && this.unit != null)
     {
         attacker.dealDamage(this.unit);
         if (unit.currentHealth <= 0)
         {
             this.resetDefault();
         }
     }
 }
예제 #3
0
파일: Field.cs 프로젝트: rene-ye/Capstone
 public void setState()
 {
     isShowing = !isShowing;
     if (isShowing)
     {
         shop.transform.localScale = Vector3.zero;
         ally.transform.localScale = boardScale;
         if (!HexGM.isShoppingRound())
         {
             enemy.transform.localScale = boardScale;
         }
     }
     else
     {
         shop.transform.localScale = shopScale;
         ally.transform.localScale = Vector3.zero;
         if (!HexGM.isShoppingRound())
         {
             enemy.transform.localScale = Vector3.zero;
         }
     }
 }