コード例 #1
0
ファイル: CargoBlock.cs プロジェクト: crassSandwich/wgj189
 public bool CanMergeWith(CargoBlock other)
 {
     return
         (!Merging &&
          !other.Merging &&
          FishType == other.FishType &&
          FishCount == other.FishCount);
 }
コード例 #2
0
ファイル: CargoBlock.cs プロジェクト: crassSandwich/wgj189
    public void MergeWith(CargoBlock other)
    {
        if (!CanMergeWith(other))
        {
            throw new System.ArgumentException("gave a bad cargo block to merge");
        }

        Merging = true;

        FishCount *= 2;
        Destroy(other.gameObject, PositionTransition.Time);
    }