Пример #1
0
        /// <summary>
        ///     The PixelVisionEngine Init() method creates the
        ///     <see cref="ChipManager" /> and <see cref="APIBridge" /> as well as any
        ///     additional chips supplied in the <see cref="defaultChips" /> array.
        /// </summary>
        /// <tocexclude />
        public virtual void Init()
        {
            chipManager = new ChipManager(this);

            //apiBridge = new APIBridge(this);
            if (defaultChips != null)
                CreateChips(defaultChips);
        }
Пример #2
0
    /**
     * エントリポイント
     *
     * @access private
     */
    void Start()
    {
        // ゲームオブジェクトのコンポーネントを取得
        ChipManager chip_manager = GetComponent <ChipManager>();        // チップ管理

        // チップ初期化
        chip_manager.init();
    }
Пример #3
0
 private static void FillByPresetChips(string[] chipMap)
 {
     for (var y = 0; y < BoardManager.BoardSize; y++)
     {
         for (var x = 0; x < BoardManager.BoardSize; x++)
         {
             var tile = BoardManager.Tiles[y, x];
             tile?.SetChip(ChipManager.CreateChipByMapValue(chipMap, y, x));
         }
     }
 }
Пример #4
0
 private static void RemoveMatches()
 {
     foreach (var tile in BoardManager.Tiles)
     {
         var chip = tile?.Chip;
         if ((chip?.IsPreset == false) && MatchFinder.IsInMatch(chip))
         {
             tile.DestroyChip();
             tile.SetChip(ChipManager.CreateChipPseudoRandom(tile.y, tile.x));
         }
     }
 }
Пример #5
0
 private static void FillByPseudoRandomChips()
 {
     for (var y = 0; y < BoardManager.BoardSize; y++)
     {
         for (var x = 0; x < BoardManager.BoardSize; x++)
         {
             var tile = BoardManager.Tiles[y, x];
             if (tile?.Chip != null)
             {
                 continue;
             }
             tile?.SetChip(ChipManager.CreateChipPseudoRandom(y, x));
         }
     }
 }
Пример #6
0
    private Sequence TrySpawnChip(float spawnDelay)
    {
        if (Tile == null)
        {
            return(null);
        }

        if (Tile.Chip != null)
        {
            return(null);
        }

        Tile.SetChip(ChipManager.CreateRandomChip());
        Tile.Chip.transform.position += Vector3.up * TileManager.TileSize;
        var chipSprite = Tile.Chip.GetComponent <SpriteRenderer>();
        var tmp        = chipSprite.color;

        tmp.a            = 0f;
        chipSprite.color = tmp;
        var seqSpawn = DOTween.Sequence().Append(Tile.Chip.Appear(spawnDelay));

        return(seqSpawn);
    }
Пример #7
0
 /**
  * エントリポイント
  *
  * @access private
  */
 void Start()
 {
     // ゲームオブジェクトのコンポーネントを取得
     this._chip_manager = GetComponent <ChipManager>();              // チップ管理
 }