Ejemplo n.º 1
0
 public void init(int _col, int _row, GameModel.SpType _type, GameManager _manager)
 {
     col     = _col;
     row     = _row;
     type    = _type;
     Manager = _manager;
     // 随机生成样式
     genStyle();
 }
Ejemplo n.º 2
0
    // 创建新元素
    private GameObject createNewItems(int row, int col, GameModel.SpType type, bool isTemp = false)
    {
        GameObject newSp = Instantiate(_model.getSpPrefabByType(type), calPos(row, col), Quaternion.identity, transform);

        newSp.GetComponent <GameSp>().init(row, col, type, Instance);

        if (!isTemp)
        {
            spArr[row, col] = newSp;
        }
        return(newSp);
    }