Esempio n. 1
0
    private void Start()
    {
        SampleCell.cellTemplate = cellTemplate;
        var simpleCellConfig = new Dictionary <SampleCell, int>()
        {
            { new SampleCell {
                  type = 1, color = Color.red
              }, 10 },
            { new SampleCell {
                  type = 2, color = Color.green
              }, 10 },
            { new SampleCell {
                  type = 3, color = Color.blue
              }, 10 },
            { new SampleCell {
                  type = 4, color = Color.yellow
              }, 10 },
        };
        var cellPool = new SampleCellPool <SampleCell>()
        {
            cellCounts = simpleCellConfig
        };

        board = new Board <SampleCell>(8, 8)
        {
            cellSize = new Vector2Int(50, 50),
            gap      = new Vector2Int(10, 10),
            cellRoot = cellRoot,
            cellPool = cellPool,
        };
        board.SetVonNeumannNeighbour();

        intractable = true;
    }
Esempio n. 2
0
    private void Start()
    {
        if (instance == null)
        {
            instance = this;
        }

        TNTCell.SetTemplate(cellTemplate);
        var simpleCellConfig = new Dictionary <TNTCell, int>()
        {
            { new TNTCell {
                  type = 1, color = Color.red
              }, 10 },
            { new TNTCell {
                  type = 2, color = Color.green
              }, 10 },
            { new TNTCell {
                  type = 3, color = Color.blue
              }, 10 },
            { new TNTCell {
                  type = 4, color = Color.yellow
              }, 10 },
        };

        cellPool = new SampleCellPool <TNTCell>
        {
            cellCounts = simpleCellConfig
        };

        cellBlocks = new List <TNTCellBlock>();

        enemyPool = new EnemyPool
        {
            floatMin = -1,
            floatMax = 3,
            ttk      = new Dictionary <Enemy, int>
            {
                {
                    new Enemy
                    {
                        hpMax      = 100,
                        atk        = 10,
                        friction   = 1,
                        bounciness = 0,
                    },
                    10
                },
                {
                    new Enemy
                    {
                        hpMax      = 150,
                        atk        = 7,
                        friction   = 1,
                        bounciness = 0,
                    },
                    15
                }
            }
        };

        debug.onClick.AddListener(() =>
                                  EditorGUIUtility.PingObject(cellBlocks.LastOrDefault(cellBlock =>
                                                                                       !cellBlock.GetComponent <Rigidbody2D>().IsSleeping())));

        waitingTimePerStep = new List <float>();
        waitingTimePerMove = new List <float>();

        intractable = true;
    }